1
Fork 0

make read_immediate error immediately on uninit, so ImmTy can carry initialized Scalar

This commit is contained in:
Ralf Jung 2022-08-01 19:05:20 -04:00
parent 2e52fe01cf
commit 30fa931f92
51 changed files with 491 additions and 747 deletions

View file

@ -129,8 +129,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
}
Assert { ref cond, expected, ref msg, target, cleanup } => {
let cond_val =
self.read_immediate(&self.eval_operand(cond, None)?)?.to_scalar()?.to_bool()?;
let cond_val = self.read_scalar(&self.eval_operand(cond, None)?)?.to_bool()?;
if expected == cond_val {
self.go_to_block(target);
} else {