From: Benjamin Kramer Date: Fri, 9 May 2014 09:48:03 +0000 (+0000) Subject: [asan] Stop leaking X86Operands. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d8d1a7c95070e5f1ae4b4cb90994736203bfc3e6;p=oota-llvm.git [asan] Stop leaking X86Operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208400 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp b/lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp index 303bbf249b5..85c7bf00972 100644 --- a/lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp +++ b/lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp @@ -192,8 +192,8 @@ void X86AddressSanitizer64::InstrumentMemOperandImpl(X86Operand *Op, Inst.addOperand(MCOperand::CreateReg(X86::RSP)); const MCExpr *Disp = MCConstantExpr::Create(-128, Ctx); - X86Operand *Op = - X86Operand::CreateMem(0, Disp, X86::RSP, 0, 1, SMLoc(), SMLoc()); + std::unique_ptr Op( + X86Operand::CreateMem(0, Disp, X86::RSP, 0, 1, SMLoc(), SMLoc())); Op->addMemOperands(Inst, 5); EmitInstruction(Out, Inst); } @@ -221,8 +221,8 @@ void X86AddressSanitizer64::InstrumentMemOperandImpl(X86Operand *Op, Inst.addOperand(MCOperand::CreateReg(X86::RSP)); const MCExpr *Disp = MCConstantExpr::Create(128, Ctx); - X86Operand *Op = - X86Operand::CreateMem(0, Disp, X86::RSP, 0, 1, SMLoc(), SMLoc()); + std::unique_ptr Op( + X86Operand::CreateMem(0, Disp, X86::RSP, 0, 1, SMLoc(), SMLoc())); Op->addMemOperands(Inst, 5); EmitInstruction(Out, Inst); }