Skip to content

Commit a524a9a

Browse files
committed
Miri terminator handling: only do progress sanity check for 'Call' terminator
1 parent e6cef04 commit a524a9a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/librustc_mir/interpret/step.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
279279
self.tcx.span = terminator.source_info.span;
280280
self.memory.tcx.span = terminator.source_info.span;
281281

282-
let old_stack = self.cur_frame();
283-
let old_bb = self.frame().block;
284-
285282
self.eval_terminator(terminator)?;
286283
if !self.stack.is_empty() {
287-
// This should change *something*
288-
assert!(self.cur_frame() != old_stack || self.frame().block != old_bb);
289284
if let Some(block) = self.frame().block {
290285
info!("// executing {:?}", block);
291286
}

src/librustc_mir/interpret/terminator.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
5252
}
5353

5454
Call { ref func, ref args, destination, ref cleanup, .. } => {
55+
let old_stack = self.cur_frame();
56+
let old_bb = self.frame().block;
5557
let func = self.eval_operand(func, None)?;
5658
let (fn_val, abi) = match func.layout.ty.kind {
5759
ty::FnPtr(sig) => {
@@ -72,6 +74,9 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
7274
None => None,
7375
};
7476
self.eval_fn_call(fn_val, abi, &args[..], ret, *cleanup)?;
77+
// Sanity-check that `eval_fn_call` either pushed a new frame or
78+
// did a jump to another block.
79+
assert!(self.cur_frame() != old_stack || self.frame().block != old_bb);
7580
}
7681

7782
Drop { location, target, unwind } => {

0 commit comments

Comments
 (0)