[lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementation
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Fri, 3 Mar 2023 20:35:42 +0000 (12:35 -0800)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Sat, 4 Mar 2023 03:33:02 +0000 (19:33 -0800)
commitebdbc26a3e79e64e9b2786a8b413618a5b5c115d
tree3dbca23cec53800e961954086be051cac3c1736d
parentefc52361ddb7282825f1f813553f322bd119b830
[lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementation

When using SBProcess::GetScriptedImplementation in python, if the
process has a valid implementation, we returned a reference of the
object without incrementing the reference counting. That causes the
interpreter to crash after accessing the reference several times.

This patch address this by incrementing the reference count when passing
the valid object reference.

Differential Revision: https://reviews.llvm.org/D145260

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
lldb/bindings/python/python-typemaps.swig
lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py