From: Chris Lattner Date: Thu, 25 Jul 2002 20:52:56 +0000 (+0000) Subject: Add check to fix bug: X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a4e251822ada2f2f46f41a8f6fa0ee346faf3fcd;p=oota-llvm.git Add check to fix bug: 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 --- diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 33ae800b594..96ba4c8c54f 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -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()); } else { // Has arguments? // Loop through FunctionType's arguments and ensure they are specified