Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler miscalculates unsigned shift right #65

Closed
namazso opened this issue Jul 27, 2021 · 2 comments
Closed

compiler miscalculates unsigned shift right #65

namazso opened this issue Jul 27, 2021 · 2 comments
Assignees
Labels

Comments

@namazso
Copy link
Contributor

namazso commented Jul 27, 2021

image

@namazso namazso changed the title compiler miscalculates shifts compiler miscalculates unsigned shift right Jul 27, 2021
@compuphase compuphase self-assigned this Jul 31, 2021
@compuphase compuphase added the bug label Jul 31, 2021
@compuphase
Copy link
Owner

Fixed in commit 4afc437.
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
Copy link
Contributor Author

namazso commented Aug 1, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants