mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-20 11:29:24 +00:00
Fix a bug that cause a crash resolving questionable function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5567 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5f07a8b312
commit
fd595203bd
@ -49,8 +49,8 @@ static void ConvertCallTo(CallInst *CI, Function *Dest) {
|
||||
//
|
||||
BasicBlock::iterator BBI = CI;
|
||||
unsigned NumArgsToCopy = CI->getNumOperands()-1;
|
||||
if (CI->getNumOperands()-1 != ParamTys.size() &&
|
||||
!(CI->getNumOperands()-1 > ParamTys.size() &&
|
||||
if (NumArgsToCopy != ParamTys.size() &&
|
||||
!(NumArgsToCopy > ParamTys.size() &&
|
||||
Dest->getFunctionType()->isVarArg())) {
|
||||
std::cerr << "WARNING: Call arguments do not match expected number of"
|
||||
<< " parameters.\n";
|
||||
@ -59,6 +59,8 @@ static void ConvertCallTo(CallInst *CI, Function *Dest) {
|
||||
std::cerr << "Function resolved to: ";
|
||||
WriteAsOperand(std::cerr, Dest);
|
||||
std::cerr << "\n";
|
||||
if (NumArgsToCopy > ParamTys.size())
|
||||
NumArgsToCopy = ParamTys.size();
|
||||
}
|
||||
|
||||
std::vector<Value*> Params;
|
||||
|
Loading…
Reference in New Issue
Block a user