From: Dan Gohman Date: Thu, 19 Feb 2009 02:55:18 +0000 (+0000) Subject: Fix the logic in this assertion to properly validate the number X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=07ab52b6459f65b3e1c94d52321165688a6096aa;p=oota-llvm.git 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 --- diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 0f98ddcabb3..a611e82585c 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)!");