[llvm] r268913 - [mips] Fix use after free and an unnecessary copy introduced in r268896.
Daniel Sanders via llvm-commits
llvm-commits at lists.llvm.org
Mon May 9 06:10:57 PDT 2016
Author: dsanders
Date: Mon May 9 08:10:57 2016
New Revision: 268913
URL: http://llvm.org/viewvc/llvm-project?rev=268913&view=rev
Log:
[mips] Fix use after free and an unnecessary copy introduced in r268896.
Modified:
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=268913&r1=268912&r2=268913&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Mon May 9 08:10:57 2016
@@ -1322,8 +1322,9 @@ public:
return Op;
}
- static std::unique_ptr<MipsOperand>
- CreateRegPair(MipsOperand MOP, SMLoc S, SMLoc E, MipsAsmParser &Parser) {
+ static std::unique_ptr<MipsOperand> CreateRegPair(const MipsOperand &MOP,
+ SMLoc S, SMLoc E,
+ MipsAsmParser &Parser) {
auto Op = make_unique<MipsOperand>(k_RegPair, Parser);
Op->RegIdx.Index = MOP.RegIdx.Index;
Op->StartLoc = S;
@@ -4691,7 +4692,7 @@ MipsAsmParser::parseRegisterPair(Operand
return MatchOperand_ParseFail;
SMLoc E = Parser.getTok().getLoc();
- MipsOperand &Op = static_cast<MipsOperand &>(*Operands.back());
+ MipsOperand Op = static_cast<MipsOperand &>(*Operands.back());
Operands.pop_back();
Operands.push_back(MipsOperand::CreateRegPair(Op, S, E, *this));
More information about the llvm-commits
mailing list