diff --git a/lldb/bindings/python/python-typemaps.swig b/lldb/bindings/python/python-typemaps.swig --- a/lldb/bindings/python/python-typemaps.swig +++ b/lldb/bindings/python/python-typemaps.swig @@ -61,6 +61,8 @@ if (!$result) { $result = Py_None; Py_INCREF(Py_None); + } else { + Py_INCREF($result); } } diff --git a/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py b/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py --- a/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py +++ b/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)