summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-19 02:55:18 +0000
committerDan Gohman <gohman@apple.com>2009-02-19 02:55:18 +0000
commitc0ae249b22822b35223ad9c87f66a4ef71123965 (patch)
treeb6d25bc7e0f3322307d69daabfd18065f7ec3100
parent82191d04138e820b7f51bfdb1fd173077c4c4c21 (diff)
downloadbcm5719-llvm-c0ae249b22822b35223ad9c87f66a4ef71123965.tar.gz
bcm5719-llvm-c0ae249b22822b35223ad9c87f66a4ef71123965.zip
Fix the logic in this assertion to properly validate the number
of arguments. llvm-svn: 64999
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JIT.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
index 0f98ddcabb3..a611e82585c 100644
--- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
@@ -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)!");
OpenPOWER on IntegriCloud