[Lldb-commits] [lldb] r143156 - /lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp

Sean Callanan scallanan at apple.com
Thu Oct 27 15:16:42 PDT 2011


Author: spyffe
Date: Thu Oct 27 17:16:42 2011
New Revision: 143156

URL: http://llvm.org/viewvc/llvm-project?rev=143156&view=rev
Log:
Fixed a leak in the LLVM disassembler where the
InstructionLLVM class dropped its instruction
handle on the floor instead of releasing it
correctly.

Modified:
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp?rev=143156&r1=143155&r2=143156&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Thu Oct 27 17:16:42 2011
@@ -80,12 +80,18 @@
                                   llvm::Triple::ArchType arch_type) :
     Instruction (addr, addr_class),
     m_disassembler (disassembler),
-    m_arch_type (arch_type)
+    m_arch_type (arch_type),
+    m_inst (NULL)
 {
 }
 
 InstructionLLVM::~InstructionLLVM()
 {
+    if (m_inst)
+    {
+        EDReleaseInst(m_inst);
+        m_inst = NULL;
+    }
 }
 
 static void





More information about the lldb-commits mailing list