interpret: clobber return place when calling function

This commit is contained in:
Ralf Jung 2022-12-03 13:33:00 +01:00
parent 11663b1b48
commit 51ac2af99f

View File

@ -676,6 +676,10 @@ pub fn push_stack_frame(
return_to_block: StackPopCleanup,
) -> InterpResult<'tcx> {
trace!("body: {:#?}", body);
// Clobber previous return place contents, nobody is supposed to be able to see them any more
// This also checks dereferenceable, but not align. We rely on all constructed places being
// sufficiently aligned (in particular we rely on `deref_operand` checking alignment).
self.write_uninit(return_place)?;
// first push a stack frame so we have access to the local substs
let pre_frame = Frame {
body,