Fix IL floating point to int conversion out-of-bounds bug - #6670
Open
DRJ-YDV wants to merge 2 commits into
Open
Conversation
This introduces out-of-bounds (OOB) behavior specification for float to int IL conversions (F2SINT / F2INT) to correctly handle architecture specific behaviors when casting out-of-bounds floats. Specifically fixes the x86 issue where float casts of Inf/NaN or large numbers returned 0 instead of the indefinite value (0x80000000) as expected by the x86 specification. Fixes rizinorg#6464 Co-authored-by agent: Antigravity/Gemini
DRJ-YDV
requested review from
Rot127,
b1llow,
kazarmy,
notxvilka,
ret2libc,
thestr4ng3r and
wargio
as code owners
August 18, 2026 14:51
Co-authored-by agent: Antigravity/Gemini 3.1 Pro (High)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix IL floating point to int conversion out-of-bounds bug
This PR resolves an issue on x86 where float-to-int operations casting out-of-bounds inputs like Infinity, NaN, or extremely large numbers incorrectly evaluate to 0 instead of the architecture-expected indefinite value (0x80000000).
I've extended the \F2INT\ and \F2SINT\ IL macros and the associated internal converter to explicitly accept an out-of-bounds behavior configuration parameter. This allows each architecture lifter to specify how it expects out-of-bounds conversions to behave. For example:
Fixes #6464