]> git.lizzy.rs Git - rust.git/blobdiff - src/eval.rs
Add communicate field to evaluator and fix formatting
[rust.git] / src / eval.rs
index bc9d97b0280f14144b0a1cce9df37d23911d7a69..e80162ec1796dc40a20f9b4aa12398df2c2be85a 100644 (file)
 #[derive(Clone)]
 pub struct MiriConfig {
     pub validate: bool,
+    /// Determines if communication with the host environment is enabled.
+    pub communicate: bool,
     pub args: Vec<String>,
 
-    // The seed to use when non-determinism is required (e.g. getrandom())
-    pub seed: Option<u64>
+    /// The seed to use when non-determinism is required (e.g. getrandom())
+    pub seed: Option<u64>,
 }
 
 // Used by priroda.
@@ -33,7 +35,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
     let mut ecx = InterpCx::new(
         tcx.at(syntax::source_map::DUMMY_SP),
         ty::ParamEnv::reveal_all(),
-        Evaluator::new(),
+        Evaluator::new(config.communicate),
         MemoryExtra::new(StdRng::seed_from_u64(config.seed.unwrap_or(0)), config.validate),
     );
 
@@ -158,7 +160,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
             cur_ptr = cur_ptr.offset(char_size, tcx)?;
         }
     }
+
     assert!(args.next().is_none(), "start lang item has more arguments than expected");
 
     Ok(ecx)