llvm-project/llvm/lib/MC
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
..
MCDisassembler Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCParser [MC] Fix compiler crash in AsmParser::Lex 2017-06-09 14:04:03 +00:00
CMakeLists.txt [WebAssembly] Add skeleton MC support for the Wasm container format 2017-02-22 01:23:18 +00:00
ConstantPools.cpp Re-apply r302416: [ARM] Clear the constant pool cache on explicit .ltorg directives 2017-05-22 09:42:07 +00:00
ELFObjectWriter.cpp sink DebugCompressionType into MC for exposing to clang 2017-06-09 00:40:19 +00:00
LLVMBuild.txt
MCAsmBackend.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCAsmInfo.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCAsmInfoCOFF.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-11 00:27:28 +00:00
MCAsmInfoDarwin.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCAsmInfoELF.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCAsmInfoWasm.cpp [WebAssembly] Add skeleton MC support for the Wasm container format 2017-02-22 01:23:18 +00:00
MCAsmStreamer.cpp This patch closes PR#32216: Better testing of schedule model instruction latencies/throughputs. 2017-04-14 07:44:23 +00:00
MCAssembler.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCCodeEmitter.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-08 22:23:19 +00:00
MCCodeView.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCContext.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCDwarf.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCELFObjectTargetWriter.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-07 23:02:00 +00:00
MCELFStreamer.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCExpr.cpp [MachO] Fix codegen of alias of alias. 2017-06-08 20:49:03 +00:00
MCFragment.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCInst.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-11 00:27:28 +00:00
MCInstPrinter.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCInstrAnalysis.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCInstrDesc.cpp Replace uint16_t with the MCPhysReg typedef in many places. A lot of physical register arrays already use this typedef. 2015-12-05 07:13:35 +00:00
MCLabel.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-08 22:23:19 +00:00
MCLinkerOptimizationHint.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-11 00:27:28 +00:00
MCMachOStreamer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCMachObjectTargetWriter.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-11 00:27:28 +00:00
MCNullStreamer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCObjectFileInfo.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCObjectStreamer.cpp MCObjectStreamer : fail with a diagnostic when emitting an out of range value. 2017-05-15 08:43:27 +00:00
MCObjectWriter.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCRegisterInfo.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCSchedule.cpp
MCSection.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCSectionCOFF.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCSectionELF.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCSectionMachO.cpp Fix the GCC build. 2017-01-30 19:05:09 +00:00
MCSectionWasm.cpp [WebAssembly] Add skeleton MC support for the Wasm container format 2017-02-22 01:23:18 +00:00
MCStreamer.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCSubtargetInfo.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCSymbol.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCSymbolELF.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCTargetOptions.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCValue.cpp Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
MCWasmObjectTargetWriter.cpp [WebAssembly] Remove unused methods from MCWasmObjectTargetWriter 2017-06-06 16:38:59 +00:00
MCWasmStreamer.cpp MC: De-duplicate the object streamer implementations of EmitFileDirective into MCObjectStreamer. NFCI. 2017-03-03 21:22:06 +00:00
MCWin64EH.cpp [MC] Create unique .pdata sections for every .text section 2016-05-02 23:22:18 +00:00
MCWinEH.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MachObjectWriter.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
StringTableBuilder.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
SubtargetFeature.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
WasmObjectWriter.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
WinCOFFObjectWriter.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
WinCOFFStreamer.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00