1
Fork 0

Distinguish between library and lang UB in assert_unsafe_precondition

This commit is contained in:
Ben Kimock 2024-02-26 21:25:27 -05:00
parent 46b180ec24
commit 5a93a59fd5
47 changed files with 415 additions and 263 deletions

View file

@ -639,7 +639,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
NullOp::OffsetOf(fields) => {
op_layout.offset_of_subfield(self, fields.iter()).bytes()
}
NullOp::DebugAssertions => return None,
NullOp::UbCheck(_) => return None,
};
ImmTy::from_scalar(Scalar::from_target_usize(val, self), layout).into()
}