1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Fix the logic in this assertion to properly validate the number

of arguments.

llvm-svn: 64999
This commit is contained in:
Dan Gohman 2009-02-19 02:55:18 +00:00
parent d4a9fb3478
commit e7a4098f7a

View File

@ -356,8 +356,9 @@ GenericValue JIT::runFunction(Function *F,
const FunctionType *FTy = F->getFunctionType();
const Type *RetTy = FTy->getReturnType();
assert((FTy->getNumParams() <= ArgValues.size() || FTy->isVarArg()) &&
"Too many arguments passed into function!");
assert((FTy->getNumParams() == ArgValues.size() ||
(FTy->isVarArg() && FTy->getNumParams() <= ArgValues.size())) &&
"Wrong number of arguments passed into function!");
assert(FTy->getNumParams() == ArgValues.size() &&
"This doesn't support passing arguments through varargs (yet)!");