diff options
author | Enrico Granata <egranata@apple.com> | 2013-06-11 19:13:50 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-06-11 19:13:50 +0000 |
commit | 05db523f3cc595ad327537501eb1fa14098c56f8 (patch) | |
tree | 117ff1b6a2fc3eaed13958bc86f8c1a5edde15f5 /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
parent | 8b86c6c509b53448c6d01f2be0da6507dbd2ad01 (diff) | |
download | bcm5719-llvm-05db523f3cc595ad327537501eb1fa14098c56f8.tar.gz bcm5719-llvm-05db523f3cc595ad327537501eb1fa14098c56f8.zip |
Making our Python decrefs NULL-safe
llvm-svn: 183774
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index da80e0ce0e8..5ad38c2fc9b 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -539,7 +539,7 @@ ScriptInterpreterPython::~ScriptInterpreterPython () Locker locker(this, ScriptInterpreterPython::Locker::AcquireLock, ScriptInterpreterPython::Locker::FreeLock); - Py_DECREF ((PyObject*)m_new_sysout); + Py_XDECREF ((PyObject*)m_new_sysout); } } @@ -788,10 +788,10 @@ ScriptInterpreterPython::ExecuteOneLine (const char *command, CommandReturnObjec PythonInputReaderManager py_input(options.GetEnableIO() ? this : NULL); pvalue = PyObject_CallObject (pfunc, pargs); } - Py_DECREF (pargs); + Py_XDECREF (pargs); if (pvalue != NULL) { - Py_DECREF (pvalue); + Py_XDECREF (pvalue); success = true; } else if (options.GetMaskoutErrors() && PyErr_Occurred ()) @@ -1059,7 +1059,7 @@ ScriptInterpreterPython::ExecuteOneLineWithReturn (const char *in_string, if (locals != NULL && should_decrement_locals) - Py_DECREF (locals); + Py_XDECREF (locals); if (py_return != NULL) { @@ -1150,7 +1150,7 @@ ScriptInterpreterPython::ExecuteOneLineWithReturn (const char *in_string, break; } } - Py_DECREF (py_return); + Py_XDECREF (py_return); if (success) ret_success = true; else @@ -1223,10 +1223,10 @@ ScriptInterpreterPython::ExecuteMultipleLines (const char *in_string, const Exec if (py_return != NULL) { success = true; - Py_DECREF (py_return); + Py_XDECREF (py_return); } if (locals && should_decrement_locals) - Py_DECREF (locals); + Py_XDECREF (locals); } } } |