[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. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205135 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth 2014-03-30 09:08:07 +00:00
parent bcf0c5fd73
commit 1f408b1474

View File

@ -2653,7 +2653,7 @@ ARM64AsmParser::tryParseSystemRegister(OperandVector &Operands) {
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)