Add check to fix bug:
authorChris Lattner <sabre@nondot.org>
Thu, 25 Jul 2002 20:52:56 +0000 (20:52 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 25 Jul 2002 20:52:56 +0000 (20:52 +0000)
test/Regression/Assembler/2002-07-25-ParserAssertionFailure.llx

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3101 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/llvmAsmParser.y

index 33ae800b594284247be7067540821e2239f4c780..96ba4c8c54fd2205fa8b786754e828876420140b 100644 (file)
@@ -1543,6 +1543,11 @@ InstVal : BinaryOps Types ValueRef ',' ValueRef {
 
     // Create the call node...
     if (!$5) {                                   // Has no arguments?
+      // Make sure no arguments is a good thing!
+      if (Ty->getNumParams() != 0)
+        ThrowException("No arguments passed to a function that "
+                       "expects arguments!");
+
       $$ = new CallInst(V, vector<Value*>());
     } else {                                     // Has arguments?
       // Loop through FunctionType's arguments and ensure they are specified