Remove undefined behavior from shifts

`asl` and `asr` in `src/link/patch.c` courtesy of @pinobatch, and rearranged in RGBASM
evaluators.
This commit is contained in:
ISSOtm
2020-01-17 09:08:49 +01:00
parent 1bd41bf79a
commit b11d121c48
10 changed files with 244 additions and 37 deletions

66
test/asm/shift.err Normal file
View File

@@ -0,0 +1,66 @@
warning: shift.asm(13) -> shift.asm::test(3): [-Wshift-amount]
Shifting left by large amount 32
warning: shift.asm(13) -> shift.asm::test(6): [-Wshift-amount]
Shifting left by large amount 32
warning: shift.asm(14) -> shift.asm::test(3): [-Wshift-amount]
Shifting left by large amount 9001
warning: shift.asm(14) -> shift.asm::test(6): [-Wshift-amount]
Shifting left by large amount 9001
warning: shift.asm(15) -> shift.asm::test(3): [-Wshift]
Shifting negative value -1
warning: shift.asm(16) -> shift.asm::test(3): [-Wshift]
Shifting negative value -1
warning: shift.asm(16) -> shift.asm::test(3): [-Wshift-amount]
Shifting left by large amount 32
warning: shift.asm(16) -> shift.asm::test(6): [-Wshift-amount]
Shifting left by large amount 32
warning: shift.asm(17) -> shift.asm::test(3): [-Wshift-amount]
Shifting left by negative value: -9001
warning: shift.asm(17) -> shift.asm::test(3): [-Wshift]
Shifting negative value -1
warning: shift.asm(17) -> shift.asm::test(3): [-Wshift-amount]
Shifting right by large amount 9001
warning: shift.asm(17) -> shift.asm::test(6): [-Wshift-amount]
Shifting left by negative amount -9001
warning: shift.asm(17) -> shift.asm::test(6): [-Wshift-amount]
Shifting right by large amount 9001
warning: shift.asm(19) -> shift.asm::test(3): [-Wshift]
Shifting negative value -1
warning: shift.asm(19) -> shift.asm::test(6): [-Wshift]
Shifting negative value -1
warning: shift.asm(20) -> shift.asm::test(3): [-Wshift]
Shifting negative value -1
warning: shift.asm(20) -> shift.asm::test(3): [-Wshift-amount]
Shifting right by large amount 32
warning: shift.asm(20) -> shift.asm::test(6): [-Wshift]
Shifting negative value -1
warning: shift.asm(20) -> shift.asm::test(6): [-Wshift-amount]
Shifting right by large amount 32
warning: shift.asm(21) -> shift.asm::test(3): [-Wshift]
Shifting negative value -1
warning: shift.asm(21) -> shift.asm::test(3): [-Wshift-amount]
Shifting right by large amount 9001
warning: shift.asm(21) -> shift.asm::test(6): [-Wshift]
Shifting negative value -1
warning: shift.asm(21) -> shift.asm::test(6): [-Wshift-amount]
Shifting right by large amount 9001
warning: shift.asm(22) -> shift.asm::test(3): [-Wshift]
Shifting negative value -4
warning: shift.asm(22) -> shift.asm::test(6): [-Wshift]
Shifting negative value -4
warning: shift.asm(23) -> shift.asm::test(3): [-Wshift]
Shifting negative value -4
warning: shift.asm(23) -> shift.asm::test(6): [-Wshift]
Shifting negative value -4
warning: shift.asm(24) -> shift.asm::test(3): [-Wshift-amount]
Shifting right by negative value: -9001
warning: shift.asm(24) -> shift.asm::test(3): [-Wshift]
Shifting negative value -1
warning: shift.asm(24) -> shift.asm::test(3): [-Wshift-amount]
Shifting left by large amount 9001
warning: shift.asm(24) -> shift.asm::test(6): [-Wshift-amount]
Shifting right by negative amount -9001
warning: shift.asm(24) -> shift.asm::test(6): [-Wshift]
Shifting negative value -1
warning: shift.asm(24) -> shift.asm::test(6): [-Wshift-amount]
Shifting left by large amount 9001