[Lldb-commits] [PATCH] D145260: [lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementation

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 3 19:33:47 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGebdbc26a3e79: [lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementation (authored by mib).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145260/new/

https://reviews.llvm.org/D145260

Files:
  lldb/bindings/python/python-typemaps.swig
  lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py


Index: lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
===================================================================
--- lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
+++ lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
@@ -80,6 +80,15 @@
         self.assertEqual(process.GetProcessID(), 666)
         self.assertEqual(process.GetNumThreads(), 0)
 
+        impl = process.GetScriptedImplementation()
+        self.assertTrue(impl)
+        impl = process.GetScriptedImplementation()
+        self.assertTrue(impl)
+        impl = process.GetScriptedImplementation()
+        self.assertTrue(impl)
+        impl = process.GetScriptedImplementation()
+        self.assertTrue(impl)
+
         addr = 0x500000000
         buff = process.ReadMemory(addr, 4, error)
         self.assertEqual(buff, None)
Index: lldb/bindings/python/python-typemaps.swig
===================================================================
--- lldb/bindings/python/python-typemaps.swig
+++ lldb/bindings/python/python-typemaps.swig
@@ -61,6 +61,8 @@
   if (!$result) {
     $result = Py_None;
     Py_INCREF(Py_None);
+  } else {
+    Py_INCREF($result);
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145260.502340.patch
Type: text/x-patch
Size: 1216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230304/d246ff7c/attachment.bin>


More information about the lldb-commits mailing list