Translate promoted constants inline#669
Merged
Nadrieril merged 4 commits intoAeneasVerif:mainfrom Apr 29, 2025
Merged
Conversation
efdb51f to
8c815ac
Compare
8c815ac to
270faf7
Compare
This was referenced Apr 29, 2025
sonmarcho
reviewed
May 1, 2025
| storage_live(@11) | ||
| storage_live(@12) | ||
| storage_live(x@1) | ||
| @9 := const (0 : u32) checked.+ const (1 : u32) |
Member
There was a problem hiding this comment.
I'm surprised that there are no checks for overflow here. Is it normal or did Charon miss something?
Member
Author
There was a problem hiding this comment.
I must have gotten mixed up with commits because I noticed and was intending to fix that. I think what happens is that the overflow check stays in the function but the addition is promoted, which confuses the binop reconstruction pass.
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.
Companion PR to cryspen/hax#1420. Hax now gives a def_id to promoted constants, which makes it super easy for charon to support them. To keep the body looking like the user wrote it, this PR also adds a pass that inlines promoted constant bodies back into their parent body. This will be made optional eventually.
ci: use cryspen/libcrux#936