fix: edge case handling in intrinsic i32::overflowing_mul#1167
Merged
Conversation
greenhat
approved these changes
Jun 10, 2026
| } | ||
|
|
||
| #[test] | ||
| #[ignore = "https://github.com/0xMiden/compiler/issues/1161"] |
Contributor
There was a problem hiding this comment.
Given that checked_mul is just overflowing_mul followed by assertz, the i32_checked_mul test should also work now.
Contributor
Author
There was a problem hiding this comment.
Oh yeah, forgot to remove the ignore. Done now.
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.
Stacked on top of #1160 to have intrinsic testing available.
i32::MIN * 0does not overflowCloses #1161
Previously: Overflow was reported for
i32::MIN * 0, though the result is 0.Now: Don't report overflow
While working on this I found another issue:
i32::MIN * odd_numberequals(true, i32::MIN)Previously: This would return
(true, 0)because of an incorrect assumption:compiler/codegen/masm/intrinsics/i32.masm
Line 145 in 30544eb
Now: Returns
(true, i32::MIN), for example