Add check to fix bug:

test/Regression/Assembler/2002-07-25-ParserAssertionFailure.llx

llvm-svn: 3101
This commit is contained in:
Chris Lattner 2002-07-25 20:52:56 +00:00
parent 65923eff65
commit 91e0832181
1 changed files with 5 additions and 0 deletions

View 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