Skip to content

Commit

Permalink
Fix debug assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Nov 11, 2019
1 parent 4ecb80d commit ee2dc4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc_mir/interpret/terminator.rs
Expand Up @@ -265,6 +265,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
match instance.def {
ty::InstanceDef::Intrinsic(..) => {
let old_stack = self.cur_frame();
let old_bb = self.frame().block;
M::call_intrinsic(self, span, instance, args, dest, ret, unwind)?;
// No stack frame gets pushed, the main loop will just act as if the
// call completed.
Expand All @@ -275,7 +276,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
// then the intrinsic implementation should have
// changed the stack frame (otherwise, we'll end
// up trying to execute this intrinsic call again)
assert!(self.cur_frame() != old_stack);
debug_assert!(self.cur_frame() != old_stack || self.frame().block != old_bb);
}
if let Some(dest) = dest {
self.dump_place(*dest)
Expand Down

0 comments on commit ee2dc4b

Please sign in to comment.