[llvm-commits] [llvm] r64999 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp

Dan Gohman gohman at apple.com
Wed Feb 18 18:55:18 PST 2009


Author: djg
Date: Wed Feb 18 20:55:18 2009
New Revision: 64999

URL: http://llvm.org/viewvc/llvm-project?rev=64999&view=rev
Log:
Fix the logic in this assertion to properly validate the number
of arguments.

Modified:
    llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp

Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=64999&r1=64998&r2=64999&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Wed Feb 18 20:55:18 2009
@@ -356,8 +356,9 @@
   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)!");
 





More information about the llvm-commits mailing list