diff options
author | Dan Gohman <gohman@apple.com> | 2009-02-19 02:55:18 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-02-19 02:55:18 +0000 |
commit | c0ae249b22822b35223ad9c87f66a4ef71123965 (patch) | |
tree | b6d25bc7e0f3322307d69daabfd18065f7ec3100 | |
parent | 82191d04138e820b7f51bfdb1fd173077c4c4c21 (diff) | |
download | bcm5719-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.cpp | 5 |
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)!"); |