Repository navigation
Conversation
|
There should probably be a trac ticket for this PR. Please create it, or ask us to create it. Then the PR title should be updated. |
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.
fmtDouble and the Round branch in ImportProject::applyMSBuildStaticFunction cast the double result of a System.Math property function to long long without a range check, so a project value like
$([System.Math]::Pow(10,30))or$([System.Math]::Round(1e30))is undefined behaviour (UBSan float-cast-overflow, as noted in the AI review on #8938). fmtDouble now takes the integer path only when the value fits in long long, and Round does its half-to-even step in double and formats through fmtDouble, so in-range results are unchanged and Round(1e30) gives the same text as Pow(10,30) instead of LLONG_MIN (out-of-range values still print via std::to_string rather than MSBuild's1E+30, which is left for a separate change). Tested with new asserts in testMSBuildStaticFunctions, the full testrunner, andcppcheck --projecton a crafted vcxproj with a UBSan build. I don't have Trac access, so could you create a ticket for this one?