compuphase / pawn

Pawn is a quick and small scripting language that requires few resources.
http://www.compuphase.com/pawn/
Other
497 stars 80 forks source link

compiler miscalculates unsigned shift right #65

Closed namazso closed 3 years ago

namazso commented 3 years ago

image

compuphase commented 3 years ago

Fixed in commit 4afc4374039b53f27a410b45dffe0d06a07ee5f8. This bug was due to the compiler using 64-bit calculations internally. For an unsigned right shift, it must truncate the value left of the >>> to the size of a cell (often 32-bits).

namazso commented 3 years ago

Thanks for the fix! And sorry for reporting so many issues in a short timespan, I just implemented my own p-code interpreter and came across these accidentally.

btw you can write "fixes #65" or "closes #65" as part of the commit message for github to automatically close the issue when the commit is pushed.