Skip to content

Translate promoted constants inline #669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 29, 2025

Conversation

Nadrieril
Copy link
Member

@Nadrieril Nadrieril commented Apr 25, 2025

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

@Nadrieril Nadrieril force-pushed the promoted-defid branch 3 times, most recently from efdb51f to 8c815ac Compare April 29, 2025 10:05
@Nadrieril Nadrieril marked this pull request as ready for review April 29, 2025 10:07
@Nadrieril Nadrieril enabled auto-merge April 29, 2025 10:07
@Nadrieril Nadrieril added this pull request to the merge queue Apr 29, 2025
Merged via the queue into AeneasVerif:main with commit f6e473a Apr 29, 2025
7 checks passed
@Nadrieril Nadrieril deleted the promoted-defid branch April 29, 2025 12:07
storage_live(@11)
storage_live(@12)
storage_live(x@1)
@9 := const (0 : u32) checked.+ const (1 : u32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that there are no checks for overflow here. Is it normal or did Charon miss something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants