[llvm] r205135 - [ARM64] Fix a heap-use-after-free spotted by ASan.
Chandler Carruth
chandlerc at gmail.com
Sun Mar 30 02:08:08 PDT 2014
Author: chandlerc
Date: Sun Mar 30 04:08:07 2014
New Revision: 205135
URL: http://llvm.org/viewvc/llvm-project?rev=205135&view=rev
Log:
[ARM64] Fix a heap-use-after-free spotted by ASan.
StringRef::lower() returns a std::string. Better yet, we can now stop
thinking about what it returns and write 'auto'. It does the right
thing. =]
Modified:
llvm/trunk/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
Modified: llvm/trunk/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp?rev=205135&r1=205134&r2=205135&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp Sun Mar 30 04:08:07 2014
@@ -2653,7 +2653,7 @@ ARM64AsmParser::tryParseSystemRegister(O
if (Tok.isNot(AsmToken::Identifier))
return MatchOperand_NoMatch;
- StringRef ID = Tok.getString().lower();
+ auto ID = Tok.getString().lower();
ARM64SYS::SystemRegister Reg =
StringSwitch<ARM64SYS::SystemRegister>(ID)
.Case("spsr_el1", ARM64SYS::SPSR_svc)
More information about the llvm-commits
mailing list