Skip to content

Commit

Permalink
add an assertion that machine hook doesn't return NoCleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Jul 7, 2024
1 parent dd5a447 commit 54e11cf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler/rustc_const_eval/src/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,10 +899,12 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
let return_to_block = frame.return_to_block;
let return_place = frame.return_place.clone();

let return_action = if cleanup {
M::after_stack_pop(self, frame, unwinding)?
let return_action;
if cleanup {
return_action = M::after_stack_pop(self, frame, unwinding)?;
assert_ne!(return_action, ReturnAction::NoCleanup);
} else {
ReturnAction::NoCleanup
return_action = ReturnAction::NoCleanup;
};

Ok(StackPopInfo { return_action, return_to_block, return_place })
Expand Down

0 comments on commit 54e11cf

Please sign in to comment.