const prop nonsense eliminated

This commit is contained in:
Oli Scherer 2024-01-05 17:31:38 +00:00
parent 6ecb2aa580
commit 1f398abcb6
6 changed files with 32 additions and 58 deletions

View file

@ -643,11 +643,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
let layout = self.layout_of_local(frame, local, layout)?;
let op = *frame.locals[local].access()?;
if matches!(op, Operand::Immediate(_)) {
if layout.is_unsized() {
// ConstProp marks *all* locals as `Immediate::Uninit` since it cannot
// efficiently check whether they are sized. We have to catch that case here.
throw_inval!(ConstPropNonsense);
}
assert!(!layout.is_unsized());
}
Ok(OpTy { op, layout })
}