diff options
author | Muhammad Omair Javaid <omair.javaid@linaro.org> | 2020-04-23 04:35:30 +0500 |
---|---|---|
committer | Muhammad Omair Javaid <omair.javaid@linaro.org> | 2020-04-23 04:38:32 +0500 |
commit | 478619cf9a24ad8eac806959ca6a289a9beb71ae (patch) | |
tree | 68bd520ed56aeac5cd6cbdd47afd3127d2eae032 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | |
parent | 328bb446ddd2c03e4da3e9aa0473fa2f1c52d34e (diff) | |
download | llvm-478619cf9a24ad8eac806959ca6a289a9beb71ae.zip llvm-478619cf9a24ad8eac806959ca6a289a9beb71ae.tar.gz llvm-478619cf9a24ad8eac806959ca6a289a9beb71ae.tar.bz2 |
Revert "get rid of PythonInteger::GetInteger()"
This reverts commit 7375212172951d2fc283c81d03c1a8588c3280c6.
This causes multiple test failures on LLDB AArch64 Linux buildbot.
http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/3695
Differential Revision: https://reviews.llvm.org/D78462
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 6f26677..c53b3bd 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -3150,15 +3150,20 @@ uint32_t ScriptInterpreterPythonImpl::GetFlagsForCommandObject( if (PyErr_Occurred()) PyErr_Clear(); - long long py_return = unwrapOrSetPythonException( - As<long long>(implementor.CallMethod(callee_name))); + // right now we know this function exists and is callable.. + PythonObject py_return( + PyRefType::Owned, + PyObject_CallMethod(implementor.get(), callee_name, nullptr)); // if it fails, print the error but otherwise go on if (PyErr_Occurred()) { PyErr_Print(); PyErr_Clear(); - } else { - result = py_return; + } + + if (py_return.IsAllocated() && PythonInteger::Check(py_return.get())) { + PythonInteger int_value(PyRefType::Borrowed, py_return.get()); + result = int_value.GetInteger(); } return result; |