aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/JIT.cpp
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
commit07ab52b6459f65b3e1c94d52321165688a6096aa (patch)
treef0930ae576eb15e126fd3adaa83a06960de89deb /lib/ExecutionEngine/JIT/JIT.cpp
parenta3ac0c105d26f8535d03031db7e97274b3ff8159 (diff)
Fix the logic in this assertion to properly validate the number
of arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 0f98ddcabb..a611e82585 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/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)!");