about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2024-04-03 08:54:03 -0400
committerBen Kimock <kimockb@gmail.com>2024-04-06 11:21:47 -0400
commita7912cb421db4f4039048cdba2b7fc98ae295342 (patch)
treeb221c94d64c7fd610f3937d2973fb503ef3d242e /compiler/rustc_codegen_cranelift/src
parent83d0a940c65e9c276308c81107b9b21cf399cbc6 (diff)
downloadrust-a7912cb421db4f4039048cdba2b7fc98ae295342.tar.gz
rust-a7912cb421db4f4039048cdba2b7fc98ae295342.zip
Put checks that detect UB under their own flag below debug_assertions
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src')
-rw-r--r--compiler/rustc_codegen_cranelift/src/base.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs
index 0aa2bae8f78..1307a62a60d 100644
--- a/compiler/rustc_codegen_cranelift/src/base.rs
+++ b/compiler/rustc_codegen_cranelift/src/base.rs
@@ -789,7 +789,7 @@ fn codegen_stmt<'tcx>(
                             layout.offset_of_subfield(fx, fields.iter()).bytes()
                         }
                         NullOp::UbChecks => {
-                            let val = fx.tcx.sess.opts.debug_assertions;
+                            let val = fx.tcx.sess.ub_checks();
                             let val = CValue::by_val(
                                 fx.bcx.ins().iconst(types::I8, i64::try_from(val).unwrap()),
                                 fx.layout_of(fx.tcx.types.bool),