Repository navigation
AssumeVal: a well-defined assumption has side effects - #1405
Merged
nunoplopes merged 1 commit intoDec 1, 2026
Merged
Conversation
A range attribute on a noundef parameter becomes a well-defined AssumeVal, which triggers UB when the value is out of range. But AssumeVal::hasSideEffects() returned false, so the transform deleted it when the parameter was unused. A function that ignores such a parameter was then treated as defined for every argument, which gives a false counterexample when the target uses the parameter and misses a bug when the target narrows the range. Report side effects for well-defined assumptions, as for division. Assisted-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A
rangeattribute on anoundefparameter becomes a well-definedAssumeVal, which is UB when the value is out of range.AssumeVal::hasSideEffects()returns false, so the transform deletes it, together with the UB, when the function does not use the parameter. That function is then treated as defined for every argument. The path is reachable again since #1394.For example, this correct transformation reports "Source is more defined than target":
and this incorrect one, which narrows the range of an unused parameter, verifies:
Make
hasSideEffects()returnis_welldefined, asBinOpdoes for division.!rangemetadata on loads is not affected, because it is lowered to a separateassume_welldefined.Assisted-by: Claude Code