mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-20 09:30:43 +00:00
Restrict InstCombine from converting varargs to or from fixed args.
More targetted fix replacing d0e277d272
.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149648 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d5917f0b4d
commit
f374486659
@ -1104,6 +1104,13 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
|||||||
PointerType *APTy = cast<PointerType>(CS.getCalledValue()->getType());
|
PointerType *APTy = cast<PointerType>(CS.getCalledValue()->getType());
|
||||||
if (FT->isVarArg()!=cast<FunctionType>(APTy->getElementType())->isVarArg())
|
if (FT->isVarArg()!=cast<FunctionType>(APTy->getElementType())->isVarArg())
|
||||||
return false;
|
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() &&
|
if (FT->getNumParams() < NumActualArgs && FT->isVarArg() &&
|
||||||
|
Loading…
Reference in New Issue
Block a user