diff options
author | Troy Butler <118708570+Troy-Butler@users.noreply.github.com> | 2024-04-22 23:17:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-22 20:17:51 -0700 |
commit | af8445e9ce4d9bd74775a68b694957640f29d28a (patch) | |
tree | 5f8d01d71695acdecf2b786ab25caa1e2ecc19bc /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | |
parent | 28d85e2d9e9f3b62554ad8446095aac275022c3c (diff) | |
download | llvm-af8445e9ce4d9bd74775a68b694957640f29d28a.zip llvm-af8445e9ce4d9bd74775a68b694957640f29d28a.tar.gz llvm-af8445e9ce4d9bd74775a68b694957640f29d28a.tar.bz2 |
[lldb] Replace condition that always evaluates to false (#89685)
Addresses issue #87243.
The current code incorrectly checks the validity of ```obj``` twice when
it should be checking the new ```str_obj``` pointer.
Signed-off-by: Troy-Butler <squintik@outlook.com>
Co-authored-by: Troy-Butler <squintik@outlook.com>
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index ea0a1cd..7c7035e 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -61,7 +61,7 @@ Expected<std::string> python::As<std::string>(Expected<PythonObject> &&obj) { if (!obj) return obj.takeError(); PyObject *str_obj = PyObject_Str(obj.get().get()); - if (!obj) + if (!str_obj) return llvm::make_error<PythonException>(); auto str = Take<PythonString>(str_obj); auto utf8 = str.AsUTF8(); |