From: Benjamin Kramer Date: Thu, 14 Jul 2011 18:41:22 +0000 (+0000) Subject: Don't leak operands when putting them into a shift. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=eac0796542d098caa371856d545faa6cdab5aad3;p=oota-llvm.git Don't leak operands when putting them into a shift. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135169 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 2c45d2e7be8..6783bc3da02 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -1085,7 +1085,7 @@ int ARMAsmParser::TryParseShiftRegister( // The source register for the shift has already been added to the // operand list, so we need to pop it off and combine it into the shifted // register operand instead. - ARMOperand *PrevOp = (ARMOperand*)Operands.pop_back_val(); + OwningPtr PrevOp((ARMOperand*)Operands.pop_back_val()); if (!PrevOp->isReg()) return Error(PrevOp->getStartLoc(), "shift must be of a register"); int SrcReg = PrevOp->getReg();