Revert "Don't duplicate check_abi()"

This reverts commit 1c7d7471da.
This commit is contained in:
hyd-dev 2021-03-17 21:51:07 +08:00
parent bbc348539b
commit 3ee865461f
No known key found for this signature in database
GPG key ID: 74FA7FD5B8DA14B8

View file

@ -169,7 +169,9 @@ 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();
check_abi(caller_abi, callee_abi)?;
if callee_abi != caller_abi {
throw_ub_format!("calling a function with ABI {} using caller ABI {}", callee_abi.name(), caller_abi.name())
}
// Push frame.
let mir = &*this.load_mir(f.def, None)?;