span: Span,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx, M::PointerTag>],
- dest: PlaceTy<'tcx, M::PointerTag>,
+ dest: Option<PlaceTy<'tcx, M::PointerTag>>,
) -> InterpResult<'tcx, bool> {
let substs = instance.substs;
+ // We currently do not handle any diverging intrinsics.
+ let dest = match dest {
+ Some(dest) => dest,
+ None => return Ok(false)
+ };
let intrinsic_name = &*self.tcx.item_name(instance.def_id()).as_str();
+
match intrinsic_name {
"caller_location" => {
let topmost = span.ctxt().outer_expn().expansion_cause().unwrap_or(span);
Ok(true)
}
- /// "Intercept" a function call because we have something special to do for it.
+ /// "Intercept" a function call to a panic-related function
+ /// because we have something special to do for it.
/// Returns `true` if an intercept happened.
- pub fn hook_fn(
+ pub fn hook_panic_fn(
&mut self,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx, M::PointerTag>],