mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 12:02:58 +02:00
Restrict InstCombine from converting varargs to or from fixed args.
More targetted fix replacing d0e277d272d517ca1cda368267d199f0da7cad95. llvm-svn: 149648
This commit is contained in:
parent
bc7e9b3c96
commit
12f2a6322e
@ -1104,6 +1104,13 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
PointerType *APTy = cast<PointerType>(CS.getCalledValue()->getType());
|
||||
if (FT->isVarArg()!=cast<FunctionType>(APTy->getElementType())->isVarArg())
|
||||
return false;
|
||||
|
||||
// If both the callee and the cast type are varargs, we still have to make
|
||||
// sure the number of fixed parameters are the same or we have the same
|
||||
// ABI issues as if we introduce a varargs call.
|
||||
if (FT->getNumParams() !=
|
||||
cast<FunctionType>(APTy->getElementType())->getNumParams())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (FT->getNumParams() < NumActualArgs && FT->isVarArg() &&
|
||||
|
Loading…
Reference in New Issue
Block a user