Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp =================================================================== --- lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp +++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp @@ -130,17 +130,17 @@ ScriptedProcessPythonInterface::GetGenericInteger(llvm::StringRef method_name) { Locker py_lock(&m_interpreter, Locker::AcquireLock | Locker::NoSTDIN, Locker::FreeLock); - + size_t gen_int_val = std::numeric_limits::max(); if (!m_object_instance_sp) - return LLDB_INVALID_ADDRESS; + return gen_int_val; if (!m_object_instance_sp) - return LLDB_INVALID_ADDRESS; + return gen_int_val; PythonObject implementor(PyRefType::Borrowed, (PyObject *)m_object_instance_sp->GetValue()); if (!implementor.IsAllocated()) - return LLDB_INVALID_ADDRESS; + return gen_int_val; PythonObject pmeth( PyRefType::Owned, @@ -150,12 +150,12 @@ PyErr_Clear(); if (!pmeth.IsAllocated()) - return LLDB_INVALID_ADDRESS; + return gen_int_val; if (PyCallable_Check(pmeth.get()) == 0) { if (PyErr_Occurred()) PyErr_Clear(); - return LLDB_INVALID_ADDRESS; + return gen_int_val; } if (PyErr_Occurred()) @@ -173,9 +173,9 @@ if (py_return.get()) { auto size = py_return.AsUnsignedLongLong(); - return (size) ? *size : LLDB_INVALID_ADDRESS; + return (size) ? *size : gen_int_val; } - return LLDB_INVALID_ADDRESS; + return gen_int_val; } lldb::MemoryRegionInfoSP @@ -274,7 +274,7 @@ lldb::pid_t ScriptedProcessPythonInterface::GetProcessID() { size_t pid = GetGenericInteger("get_process_id"); - return (pid >= std::numeric_limits::max()) + return (pid >= std::numeric_limits::max()) ? LLDB_INVALID_PROCESS_ID : pid; }