summaryrefslogtreecommitdiff
path: root/scripts/linux
diff options
context:
space:
mode:
authorDavid Racine <bass_dr@hotmail.com>2026-10-09 09:49:46 -0400
committerGitHub <noreply@github.com>2026-10-09 13:49:46 +0000
commit6e7a9b47f0078eb1ed8da18b5211bfd2e181097f (patch)
tree111ad4420c421b2a9e1ee7b665a8ef16f68908dc /scripts/linux
parent1595a94df319a105d684f03a1cc631de518915eb (diff)
Fix undefined left shifts of 1 by 31 (#6640)
Shifting a signed 1 into the sign bit is undefined, and UBSan reports it as "left shift of 1 by 31 places cannot be represented in type 'int'". The switch-flag helpers in z_actor.c take the bit position at runtime, so every flag from 0x00 to 0x3F goes through the same shift. Flag 0x3F lands on bit 31: the Potion Shop Granny sets and clears it while brewing the Odd Potion, so this is reached in ordinary play, not just in theory. The same shift appears as a constant in gBitFlags, in the two player state flags that occupy bit 31, and in ENHORSE_FLAG_31. Suffixing the 1 with u moves the shift to unsigned, where the value is defined. Every flag field involved is already u32, so the results are unchanged.
Diffstat (limited to 'scripts/linux')
0 files changed, 0 insertions, 0 deletions