]> git.lizzy.rs Git - rust.git/blobdiff - src/machine.rs
rename track-raw-pointers flag to tag-raw-pointers
[rust.git] / src / machine.rs
index fb39503b538589b95c6409cb8009221142a2c819..201854e76fa46052bfed004367fb6fc4f7dd47de 100644 (file)
@@ -194,7 +194,7 @@ pub fn new(config: &MiriConfig) -> Self {
             Some(RefCell::new(stacked_borrows::GlobalState::new(
                 config.tracked_pointer_tag,
                 config.tracked_call_id,
-                config.track_raw,
+                config.tag_raw,
             )))
         } else {
             None
@@ -304,6 +304,9 @@ pub struct Evaluator<'mir, 'tcx> {
     /// Whether to enforce the validity invariant.
     pub(crate) validate: bool,
 
+    /// Whether to enforce validity (e.g., initialization) of integers and floats.
+    pub(crate) enforce_number_validity: bool,
+
     /// Whether to enforce [ABI](Abi) of function calls.
     pub(crate) enforce_abi: bool,
 
@@ -356,6 +359,7 @@ pub(crate) fn new(config: &MiriConfig, layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>)
             tls: TlsData::default(),
             isolated_op: config.isolated_op,
             validate: config.validate,
+            enforce_number_validity: config.check_number_validity,
             enforce_abi: config.check_abi,
             file_handler: Default::default(),
             dir_handler: Default::default(),
@@ -426,6 +430,11 @@ fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
         ecx.machine.validate
     }
 
+    #[inline(always)]
+    fn enforce_number_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
+        ecx.machine.enforce_number_validity
+    }
+
     #[inline(always)]
     fn enforce_abi(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
         ecx.machine.enforce_abi
@@ -457,7 +466,7 @@ fn call_extra_fn(
 
     #[inline(always)]
     fn call_intrinsic(
-        ecx: &mut rustc_mir::interpret::InterpCx<'mir, 'tcx, Self>,
+        ecx: &mut rustc_const_eval::interpret::InterpCx<'mir, 'tcx, Self>,
         instance: ty::Instance<'tcx>,
         args: &[OpTy<'tcx, Tag>],
         ret: Option<(&PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
@@ -482,7 +491,7 @@ fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>, msg: String) -> InterpResult<'tc
 
     #[inline(always)]
     fn binary_ptr_op(
-        ecx: &rustc_mir::interpret::InterpCx<'mir, 'tcx, Self>,
+        ecx: &rustc_const_eval::interpret::InterpCx<'mir, 'tcx, Self>,
         bin_op: mir::BinOp,
         left: &ImmTy<'tcx, Tag>,
         right: &ImmTy<'tcx, Tag>,