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
This commit is contained in:
Benjamin Kramer 2011-07-14 18:41:22 +00:00
parent 3b14a5c546
commit eac0796542

View 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();