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

Infinite loop on jump tables in 64 bit addressing #850

Closed

Conversation

GregoryMorse
Copy link
Contributor

@GregoryMorse GregoryMorse commented Jul 27, 2019

Jump tables with a NZMask of 0xFFFF000000000000 would cause the int4 stride value to overflow to 0 on shift left after 32 times. At that point a 0 stride is returned. In the range this then causes a modulo division by 0 which VS2019 caught immediately. However in the current code somehow the division by 0 is not thrown and instead it just causes an infinite querying loop of the same address.

It starts addressing #729 as MIPS can this NZMask detected quite frequently - still getting too many branches however when the jump table should be easily recovered.

It appears that 0xFFFF000000000000 being the stride is likely the cause of the too many jump targets bug as well. Perhaps this should be fixed to be 64 bit not by simply avoiding 0.

Jump tables with a NZMask of 0xFFFF000000000000 would cause the int4 stride value to overflow to 0 on shift left after 32 times.  At that point a 0 stride is returned.  In the range this then causes a modulo division by 0 which VS2019 caught immediately.  However in the current code somehow the division by 0 is not thrown and instead it just causes an infinite querying loop of the same address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants