This gets Miri working again, but doesn't actually implement unwinding
};
e.print_backtrace();
if let Some(frame) = ecx.stack().last() {
};
e.print_backtrace();
if let Some(frame) = ecx.stack().last() {
- let block = &frame.body.basic_blocks()[frame.block];
+ let block = &frame.body.basic_blocks()[frame.block.unwrap()];
let span = if frame.stmt < block.statements.len() {
block.statements[frame.stmt].source_info.span
} else {
let span = if frame.stmt < block.statements.len() {
block.statements[frame.stmt].source_info.span
} else {
args: &[OpTy<'tcx, Tag>],
dest: Option<PlaceTy<'tcx, Tag>>,
ret: Option<mir::BasicBlock>,
args: &[OpTy<'tcx, Tag>],
dest: Option<PlaceTy<'tcx, Tag>>,
ret: Option<mir::BasicBlock>,
+ _unwind: Option<mir::BasicBlock>,
) -> InterpResult<'tcx, Option<&'mir mir::Body<'tcx>>> {
ecx.find_fn(instance, args, dest, ret)
}
) -> InterpResult<'tcx, Option<&'mir mir::Body<'tcx>>> {
ecx.find_fn(instance, args, dest, ret)
}
span: Span,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx, Tag>],
span: Span,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx, Tag>],
- dest: PlaceTy<'tcx, Tag>,
+ dest: Option<PlaceTy<'tcx, Tag>>,
+ _ret: Option<mir::BasicBlock>,
+ _unwind: Option<mir::BasicBlock>
) -> InterpResult<'tcx> {
) -> InterpResult<'tcx> {
+ let dest = match dest {
+ Some(dest) => dest,
+ None => throw_ub!(Unreachable)
+ };
ecx.call_intrinsic(span, instance, args, dest)
}
ecx.call_intrinsic(span, instance, args, dest)
}
fn stack_pop(
ecx: &mut InterpCx<'mir, 'tcx, Self>,
extra: stacked_borrows::CallId,
fn stack_pop(
ecx: &mut InterpCx<'mir, 'tcx, Self>,
extra: stacked_borrows::CallId,
- ) -> InterpResult<'tcx> {
- Ok(ecx
+ _unwinding: bool
+ ) -> InterpResult<'tcx, StackPopInfo> {
+ ecx
.memory
.extra
.stacked_borrows
.borrow_mut()
.memory
.extra
.stacked_borrows
.borrow_mut()
+ .end_call(extra);
+ Ok(StackPopInfo::Normal)
mir,
Some(ret_place),
// Directly return to caller.
mir,
Some(ret_place),
// Directly return to caller.
- StackPopCleanup::Goto(Some(ret)),
+ StackPopCleanup::Goto { ret: Some(ret), unwind: None },
)?;
let mut args = this.frame().body.args_iter();
)?;
let mut args = this.frame().body.args_iter();
dest: PlaceTy<'tcx, Tag>,
) -> InterpResult<'tcx> {
let this = self.eval_context_mut();
dest: PlaceTy<'tcx, Tag>,
) -> InterpResult<'tcx> {
let this = self.eval_context_mut();
- if this.emulate_intrinsic(span, instance, args, dest)? {
+ if this.emulate_intrinsic(span, instance, args, Some(dest))? {
return Ok(());
}
let tcx = &{this.tcx.tcx};
return Ok(());
}
let tcx = &{this.tcx.tcx};
);
// First, run the common hooks also supported by CTFE.
);
// First, run the common hooks also supported by CTFE.
- if this.hook_fn(instance, args, dest)? {
+ if this.hook_panic_fn(instance, args, dest)? {
this.goto_block(ret)?;
return Ok(None);
}
this.goto_block(ret)?;
return Ok(None);
}