Repository navigation
Check for right-hand operand of zero in lrem and irem - #6864
Merged
jdmpapin merged 1 commit intoJan 16, 2023
Merged
Conversation
Contributor
Author
|
Devin @jdmpapin, may I ask you to review this fix? |
Contributor
Author
|
Daryl @0xdaryl, may I ask you to review as well? |
jdmpapin
reviewed
Jan 13, 2023
jdmpapin
left a comment
Contributor
There was a problem hiding this comment.
Actual fix looks reasonable
The constrainIrem and constrainLrem methods guard against a right-hand operand of zero if the left-hand operand is a constant, but not if the left-hand operand is a non-constant. In the latter case, a constraint in the range [1,-1] results. This change adds an additional check for a right-hand operand equal to zero if the left-hand operand is non-constant, avoiding creating an erroneous constraint for the result. Signed-off-by: Henry Zongaro <zongaro@ca.ibm.com>
hzongaro
force-pushed
the
vp-division-by-zero-in-lrem-irem
branch
from
January 13, 2023 18:03
513f3f2 to
43ba527
Compare
Contributor
Author
|
Devin @jdmpapin, thanks for the review. I've removed the debugging trace messages that I had inadvertently left behind. It's ready for another review. |
jdmpapin
approved these changes
Jan 13, 2023
Contributor
|
Jenkins build all |
Contributor
Author
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.
If the following program
is run with
java -Xjit:count=0 Bug, the following assertion failure results:The problem is that the
constrainIremandconstrainLremValue Propagation handlers guard against a right-hand operand of zero if the left-hand operand is a constant, but not if the left-hand operand is a non-constant. In the latter case, a constraint in the range [1,-1] results. Notice that the upper bound of the range is less than the lower bound.This change adds an additional check for a right-hand operand equal to zero if the left-hand operand is non-constant, avoiding creating an erroneous constraint for the result.