aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-07-14 18:41:22 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-07-14 18:41:22 +0000
commiteac0796542d098caa371856d545faa6cdab5aad3 (patch)
treeef2fd207c3b692d744c3ba7ea604ba19fe58da84 /lib/Target/ARM/AsmParser/ARMAsmParser.cpp
parent3b14a5c5469176effb921d91d4494f0aa2919fd0 (diff)
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
Diffstat (limited to 'lib/Target/ARM/AsmParser/ARMAsmParser.cpp')
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 2c45d2e7be..6783bc3da0 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<ARMOperand> PrevOp((ARMOperand*)Operands.pop_back_val());
if (!PrevOp->isReg())
return Error(PrevOp->getStartLoc(), "shift must be of a register");
int SrcReg = PrevOp->getReg();