mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Rollup merge of #97767 - RalfJung:variadic, r=davidtwco
interpret: do not claim UB until we looked more into variadic functions I am not actually sure if this is UB, and anyway for FFI shims, Miri currently does not attempt to distinguish between arguments passed via variadics vs directly. So let's be consistent. (Programs that ran into this error will anyway immediately fall through to the "unsupported" message on the next line.)
This commit is contained in:
commit
85617f1c93
@ -353,12 +353,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
// FIXME: for variadic support, do we have to somehow determine callee's extra_args?
|
||||
let callee_fn_abi = self.fn_abi_of_instance(instance, ty::List::empty())?;
|
||||
|
||||
if callee_fn_abi.c_variadic != caller_fn_abi.c_variadic {
|
||||
throw_ub_format!(
|
||||
"calling a c-variadic function via a non-variadic call site, or vice versa"
|
||||
);
|
||||
}
|
||||
if callee_fn_abi.c_variadic {
|
||||
if callee_fn_abi.c_variadic || caller_fn_abi.c_variadic {
|
||||
throw_unsup_format!("calling a c-variadic function is not supported");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user