Fix floating-point infinity literal generation - #1123
Merged
Merged
Conversation
wrayste
force-pushed
the
infinity-patch
branch
from
September 9, 2026 15:52
e2b1ab9 to
972085d
Compare
SBE Tool accepts positive and negative Infinity for FLOAT and DOUBLE, but several target generators emit invalid source for those values. Generate width- and sign-correct infinity expressions for Java, C++, C, C#, Go, and Rust, and add parser, generator, and native regression coverage.
wrayste
force-pushed
the
infinity-patch
branch
from
September 9, 2026 15:56
972085d to
e814673
Compare
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.
SBE Tool already accepts positive and negative
Infinityvalues forFLOATandDOUBLEthroughPrimitiveValue, but several target generators treat the resulting canonicalInfinity/-Infinitystrings as ordinary finite literals.This produces invalid generated source, for example:
Infinityf,InfinitydInfinityf,InfinityInfinityf,InfinitydInfinity_f32,Infinity_f64InfinityexpressionsThis change renders those already accepted values using width- and sign-correct target-language expressions for Java, C++, C, C#, both Go generators, and Rust.
Parsing and IR representation are unchanged, as are finite-value formatting and existing NaN handling.
The change also adds regression coverage for:
FLOATandDOUBLEValidation included the SBE Tool test suite and Checkstyle, C/C++ builds with GCC and Clang, C# tests, both Go generators, Rust tests, and the full Gradle build.