diff options
| author | Ralf Jung <post@ralfj.de> | 2020-04-04 15:53:47 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-04-05 19:23:35 +0200 |
| commit | a524a9af918df6a6d3abd68a642e89f0d34b36f5 (patch) | |
| tree | c153c99a37d7fe42a08d7ca5ccdbb7ef9ac3a352 /src/librustc_mir | |
| parent | e6cef0445779724b469ab7b9a8d3c05d9e848ca8 (diff) | |
| download | rust-a524a9af918df6a6d3abd68a642e89f0d34b36f5.tar.gz rust-a524a9af918df6a6d3abd68a642e89f0d34b36f5.zip | |
Miri terminator handling: only do progress sanity check for 'Call' terminator
Diffstat (limited to 'src/librustc_mir')
| -rw-r--r-- | src/librustc_mir/interpret/step.rs | 5 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/terminator.rs | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs index 407849c2ce2..2dd732e41ee 100644 --- a/src/librustc_mir/interpret/step.rs +++ b/src/librustc_mir/interpret/step.rs @@ -279,13 +279,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { self.tcx.span = terminator.source_info.span; self.memory.tcx.span = terminator.source_info.span; - let old_stack = self.cur_frame(); - let old_bb = self.frame().block; - self.eval_terminator(terminator)?; if !self.stack.is_empty() { - // This should change *something* - assert!(self.cur_frame() != old_stack || self.frame().block != old_bb); if let Some(block) = self.frame().block { info!("// executing {:?}", block); } diff --git a/src/librustc_mir/interpret/terminator.rs b/src/librustc_mir/interpret/terminator.rs index 6ebe5b80370..161fbdc9ed4 100644 --- a/src/librustc_mir/interpret/terminator.rs +++ b/src/librustc_mir/interpret/terminator.rs @@ -52,6 +52,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { } Call { ref func, ref args, destination, ref cleanup, .. } => { + let old_stack = self.cur_frame(); + let old_bb = self.frame().block; let func = self.eval_operand(func, None)?; let (fn_val, abi) = match func.layout.ty.kind { ty::FnPtr(sig) => { @@ -72,6 +74,9 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { None => None, }; self.eval_fn_call(fn_val, abi, &args[..], ret, *cleanup)?; + // Sanity-check that `eval_fn_call` either pushed a new frame or + // did a jump to another block. + assert!(self.cur_frame() != old_stack || self.frame().block != old_bb); } Drop { location, target, unwind } => { |
