diff options
author | Craig Topper <craig.topper@intel.com> | 2019-04-09 21:37:21 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2019-04-09 21:37:21 +0000 |
commit | 60f83544bb373debc0568cc001f26b82cf803e88 (patch) | |
tree | ce7faf868bea4912bcdb85215d7d1a87c451cd2e /llvm/lib/Target/X86/AsmParser | |
parent | 9bf092d71989771fafc8c7c775dba8bb3779b5bd (diff) | |
download | bcm5719-llvm-60f83544bb373debc0568cc001f26b82cf803e88.tar.gz bcm5719-llvm-60f83544bb373debc0568cc001f26b82cf803e88.zip |
[X86] Fix a dangling StringRef issue introduced in r358029.
I was attempting to convert mnemonics to lower case after processing a pseudo prefix. But the ParseOperands just hold a StringRef for tokens so there is no where to allocate the memory.
Add FIXMEs for the lower case issue which also exists in the prefix parsing code.
llvm-svn: 358036
Diffstat (limited to 'llvm/lib/Target/X86/AsmParser')
-rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 362e57ddefd..6786d69f9fe 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -2310,7 +2310,6 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc, OperandVector &Operands) { MCAsmParser &Parser = getParser(); InstInfo = &Info; - std::string TempName; // Used when we parse a pseudo prefix. // Reset the forced VEX encoding. ForcedVEXEncoding = VEXEncoding_Default; @@ -2342,8 +2341,8 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name, } else { if (getLexer().isNot(AsmToken::Identifier)) return Error(Parser.getTok().getLoc(), "Expected identifier"); - TempName = Parser.getTok().getString().lower(); - Name = TempName; + // FIXME: The mnemonic won't match correctly if its not in lower case. + Name = Parser.getTok().getString(); Parser.Lex(); } continue; @@ -2545,6 +2544,7 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name, Flags = X86::IP_NO_PREFIX; break; } + // FIXME: The mnemonic won't match correctly if its not in lower case. Name = Parser.getTok().getString(); Parser.Lex(); // eat the prefix // Hack: we could have something like "rep # some comment" or @@ -2552,6 +2552,7 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name, while (Name.startswith(";") || Name.startswith("\n") || Name.startswith("#") || Name.startswith("\t") || Name.startswith("/")) { + // FIXME: The mnemonic won't match correctly if its not in lower case. Name = Parser.getTok().getString(); Parser.Lex(); // go to next prefix or instr } |