Don't leak operands when putting them into a shift.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 14 Jul 2011 18:41:22 +0000 (18:41 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 14 Jul 2011 18:41:22 +0000 (18:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135169 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp

index 2c45d2e7be8a83bdf28c9d4c0d3a241db7b84444..6783bc3da025f5fc24578a5e92a61aaebac3ce34 100644 (file)
@@ -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<ARMOperand> PrevOp((ARMOperand*)Operands.pop_back_val());
   if (!PrevOp->isReg())
     return Error(PrevOp->getStartLoc(), "shift must be of a register");
   int SrcReg = PrevOp->getReg();