Don't duplicate check_abi()

This commit is contained in:
hyd-dev 2021-03-17 00:40:53 +08:00
parent 0788188c7b
commit 1c7d7471da
No known key found for this signature in database
GPG Key ID: 74FA7FD5B8DA14B8

View File

@ -169,9 +169,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let this = self.eval_context_mut();
let param_env = ty::ParamEnv::reveal_all(); // in Miri this is always the param_env we use... and this.param_env is private.
let callee_abi = f.ty(*this.tcx, param_env).fn_sig(*this.tcx).abi();
if callee_abi != caller_abi {
throw_ub_format!("calling a function with ABI {} using caller ABI {}", callee_abi.name(), caller_abi.name())
}
check_abi(caller_abi, callee_abi)?;
// Push frame.
let mir = &*this.load_mir(f.def, None)?;