pawn
pawn copied to clipboard
size check of packed arrays broken on 64 bit cell size
toupper_(v)
return v >= 'a' && v <= 'z' ? v - 'a' + 'A' : v;
main() {
new str{} = "aaaaaaaaaaaaaaa";
for (new i = 0; i < sizeof(str) * (cellbits / charbits); ++i)
str{i} = toupper_(str{i});
return str{8};
}
when compiled with -C64 a BOUNDS 7
is inserted. with runtime checks disabled the program works as expected
this bug is also present on 16 bits, there it generates a BOUNDS 31
, which doesn't cause an early halt but is still incorrect
edit: https://github.com/compuphase/pawn/pull/69 should fix this