Put checks that detect UB under their own flag below debug_assertions

This commit is contained in:
Ben Kimock 2024-04-03 08:54:03 -04:00
parent 83d0a940c6
commit a7912cb421
42 changed files with 206 additions and 64 deletions

View file

@ -258,7 +258,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
let val = layout.offset_of_subfield(self, fields.iter()).bytes();
Scalar::from_target_usize(val, self)
}
mir::NullOp::UbChecks => Scalar::from_bool(self.tcx.sess.opts.debug_assertions),
mir::NullOp::UbChecks => Scalar::from_bool(self.tcx.sess.ub_checks()),
};
self.write_scalar(val, &dest)?;
}