-
Notifications
You must be signed in to change notification settings - Fork 13.3k
const-eval: disallow unwinding across functions that !fn_can_unwind()
#85546
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
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
Could you please prepare a Miri PR with just those changes? Then we can fix the toolstate ASAP without having to complete the other, much larger, PR. |
☔ The latest upstream changes (presumably #85514) made this pull request unmergeable. Please resolve the merge conflicts. |
…at are called by `eval_fn_call()`
LGTM modulo 2 small final nits. :) |
Thanks a lot. :-) |
📌 Commit f6348f1 has been approved by |
Not squashed commits ( |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@ce0d64e. Direct link to PR: <rust-lang/rust#85546> 💔 miri on windows: test-pass → build-fail (cc @eddyb @oli-obk @RalfJung). 💔 miri on linux: test-pass → build-fail (cc @eddyb @oli-obk @RalfJung).
Fix toolstate for rust-lang/rust#85546 cc rust-lang/rust#85780
Following rust-lang/miri#1776 (comment), so r? @RalfJung
This PR turns
unwind
inStackPopCleanup::Goto
into a new enumStackPopUnwind
, with aNotAllowed
variant to indicate that unwinding is not allowed. This variant is chosen based onrustc_middle::ty::layout::fn_can_unwind()
ineval_fn_call()
when pushing the frame. A check is added inunwind_to_block()
to report UB if unwinding happens across aStackPopUnwind::NotAllowed
frame.Tested with Miri
HEAD
with minor changes and the rust-lang/miri#1776 branch with these changes.