diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index 33ae800b5942..96ba4c8c54fd 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/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