================
@@ -642,6 +649,16 @@ bool
lldb_private::python::SWIGBridge::LLDBSwigPythonCallCommandObject(
pfunc(SWIGBridge::ToSWIGWrapper(std::move(debugger)), PythonString(args),
SWIGBridge::ToSWIGWrapper(exe_ctx_ref_sp), cmd_retobj_arg.obj());
+ if (PyErr_Occurred()) {
+ py_err_cleaner.~PyErr_Cleaner();
----------------
labath wrote:
I'm pretty sure this is undefined behavior (you calling the destructor does not
stop the compiler from calling it again).
I think that a proper fix for this would be to change
`PythonCallable::operator()` to return `Expected<PythonObject>` (and convert
the python exception to llvm::error, etc). A lot of the PythonDataObject
methods were converted to do that (see comment at the top of the header), but
it looks like this is not one of them.
https://github.com/llvm/llvm-project/pull/113996
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits