llvm-project/llvm/lib/MC/MCParser
Nirav Dave 670109d89a [MC] Fix compiler crash in AsmParser::Lex
When an empty comment is present in an assembly file, the compiler will crash because it checks the first character for '\n' or '\r'.
The fix consists of also checking if the string is empty before accessing the *front* method of the StringRef.
A test is included for the x86 target, but this issue is reproducible with other targets as well.

Patch by Alexandru Guduleasa!

Reviewers: niravd, grosbach, llvm-commits

Reviewed By: niravd

Differential Revision: https://reviews.llvm.org/D33993

llvm-svn: 305077
2017-06-09 14:04:03 +00:00
..
AsmLexer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
AsmParser.cpp [MC] Fix compiler crash in AsmParser::Lex 2017-06-09 14:04:03 +00:00
CMakeLists.txt Fix header path in CMake. NFC. 2015-06-19 20:49:02 +00:00
COFFAsmParser.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
DarwinAsmParser.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
ELFAsmParser.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
LLVMBuild.txt
MCAsmLexer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCAsmParser.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCAsmParserExtension.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-10 01:33:54 +00:00
MCTargetAsmParser.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00