Skip to content

Commit 3549d98

Browse files
committed
Put checks that detect UB under their own flag below debug_assertions
1 parent f91bd78 commit 3549d98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ fn codegen_stmt<'tcx>(
789789
layout.offset_of_subfield(fx, fields.iter()).bytes()
790790
}
791791
NullOp::UbChecks => {
792-
let val = fx.tcx.sess.opts.debug_assertions;
792+
let val = fx.tcx.sess.ub_checks();
793793
let val = CValue::by_val(
794794
fx.bcx.ins().iconst(types::I8, i64::try_from(val).unwrap()),
795795
fx.layout_of(fx.tcx.types.bool),

0 commit comments

Comments
 (0)