Author: Troy Butler
Date: 2024-04-22T20:17:51-07:00
New Revision: af8445e9ce4d9bd74775a68b694957640f29d28a

URL: 
https://github.com/llvm/llvm-project/commit/af8445e9ce4d9bd74775a68b694957640f29d28a
DIFF: 
https://github.com/llvm/llvm-project/commit/af8445e9ce4d9bd74775a68b694957640f29d28a.diff

LOG: [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 <squin...@outlook.com>
Co-authored-by: Troy-Butler <squin...@outlook.com>

Added: 
    

Modified: 
    lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

Removed: 
    


################################################################################
diff  --git 
a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index ea0a1cdff40f1e..7c7035e0c86c9e 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();


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to