1
Fork 0

move marking-locals-live out of push_stack_frame, so it happens with argument passing

this entirely avoids even creating unsized locals in Immediate::Uninitialized state
This commit is contained in:
Ralf Jung 2023-08-06 18:40:37 +02:00
parent bdd5855b8e
commit a09df43d9f
15 changed files with 188 additions and 105 deletions

View file

@ -376,6 +376,16 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
)
.expect("failed to push initial stack frame");
for local in body.local_decls.indices() {
// Mark everything initially live.
// This is somewhat dicey since some of them might be unsized and it is incoherent to
// mark those as live... We rely on `local_to_place`/`local_to_op` in the interpreter
// stopping us before those unsized immediates can cause issues deeper in the
// interpreter.
ecx.frame_mut().locals[local].value =
LocalValue::Live(interpret::Operand::Immediate(Immediate::Uninit));
}
ConstPropagator { ecx, tcx, param_env, local_decls: &dummy_body.local_decls }
}