Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler/rustc_const_eval/src/interpret/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
throw_ub_format!("calling a function with more arguments than it expected");
}

// All function arguments have gotten initialized, call corresponding hook.
M::after_stack_frame_init(self)?;

// Done!
self.push_stack_frame_done()
}
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_const_eval/src/interpret/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,11 @@ pub trait Machine<'tcx>: Sized {
interp_ok(())
}

/// Called immediately after a stack frame has its function arguments initialized.
fn after_stack_frame_init(_ecx: &mut InterpCx<'tcx, Self>) -> InterpResult<'tcx> {
interp_ok(())
}

/// Called just before the frame is removed from the stack (followed by return value copy and
/// local cleanup).
fn before_stack_pop(_ecx: &mut InterpCx<'tcx, Self>) -> InterpResult<'tcx> {
Expand Down
Loading