[Lldb-commits] [lldb] r200429 - <rdar://problem/15936507>

Enrico Granata egranata at apple.com
Wed Jan 29 15:18:59 PST 2014


Author: enrico
Date: Wed Jan 29 17:18:58 2014
New Revision: 200429

URL: http://llvm.org/viewvc/llvm-project?rev=200429&view=rev
Log:
<rdar://problem/15936507>

PyTuple_SetItem steals a reference to the item it inserts in the tuple
This, plus the Py_XDECREF of the tuple a few lines below, causes our session dictionary to go away after the first time a SWIG layer function is called - with disastrous effects for the first subsequent attempt to use any functionality in ScriptInterpreterPython
This fixes it


Modified:
    lldb/trunk/scripts/Python/python-wrapper.swig

Modified: lldb/trunk/scripts/Python/python-wrapper.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-wrapper.swig?rev=200429&r1=200428&r2=200429&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-wrapper.swig (original)
+++ lldb/trunk/scripts/Python/python-wrapper.swig Wed Jan 29 17:18:58 2014
@@ -135,6 +135,7 @@ public:
         {
             if (!arg)
                 return retval;
+            Py_INCREF(arg); // _SetItem steals a reference
             PyTuple_SetItem(pargs,idx,arg);
             idx++;
         }





More information about the lldb-commits mailing list