Fix #13812 value potentially truncated in ValueFlowAnalyzer::evaluteInt()#8482
Merged
chrchr-github merged 4 commits intodanmar:mainfrom Apr 23, 2026
Merged
Fix #13812 value potentially truncated in ValueFlowAnalyzer::evaluteInt()#8482chrchr-github merged 4 commits intodanmar:mainfrom
chrchr-github merged 4 commits intodanmar:mainfrom
Conversation
firewave
reviewed
Apr 23, 2026
firewave
reviewed
Apr 23, 2026
|
|
||
| #define testValueOfX(...) testValueOfX_(__FILE__, __LINE__, __VA_ARGS__) | ||
| bool testValueOfX_(const char* file, int line, const char code[], unsigned int linenr, int value, const Settings *s = nullptr) { | ||
| bool testValueOfX_(const char* file, int line, const char code[], unsigned int linenr, MathLib::bigint value, const Settings *s = nullptr) { |
Collaborator
There was a problem hiding this comment.
This smells like it should have been reported by one of the compiler warnings we have disabled...
Collaborator
Author
There was a problem hiding this comment.
Maybe, but so far all tests used only values in the int range.
Collaborator
There was a problem hiding this comment.
The comparison between value and Value::intvalue below should have triggered one for sure. That would be a different one from the implicit conversion the call would have done.
firewave
previously approved these changes
Apr 23, 2026
chrchr-github
commented
Apr 23, 2026
| MathLib::bigint out = 0; | ||
| if (pm.getContainerEmptyValue(tok->exprId(), out)) | ||
| return {static_cast<int>(out)}; | ||
| return {out}; |
Collaborator
Author
There was a problem hiding this comment.
Harmless but unnecessary (out is effectively a bool).
|
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.



No description provided.