diff options
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 33ae800b59..96ba4c8c54 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<Value*>()); } else { // Has arguments? // Loop through FunctionType's arguments and ensure they are specified |