From bc280abd460a823cf33dc50789350b042762adbc Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 30 Mar 2004 20:58:25 +0000 Subject: [PATCH] Fix bug: Assembler/2004-03-30-UnclosedFunctionCrash.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12551 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/llvmAsmParser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 2868fdd1b34..88e75e3da2b 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -1992,7 +1992,7 @@ int yyerror(const char *ErrorMsg) { = std::string((CurFilename == "-") ? std::string("") : CurFilename) + ":" + utostr((unsigned) llvmAsmlineno) + ": "; std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading "; - if (yychar == YYEMPTY) + if (yychar == YYEMPTY || yychar == 0) errMsg += "end-of-file."; else errMsg += "token: '" + std::string(llvmAsmtext, llvmAsmleng) + "'";