[Lldb-commits] [lldb] [lldb] Replace condition that always evaluates to false (PR #89685)

Troy Butler via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 22 16:18:32 PDT 2024


https://github.com/Troy-Butler created https://github.com/llvm/llvm-project/pull/89685

Addresses issue #87243. 

>From 20c093a1cd51adab9387e9a15fca7c8b592f3f21 Mon Sep 17 00:00:00 2001
From: Troy-Butler <squintik at outlook.com>
Date: Mon, 22 Apr 2024 19:17:08 -0400
Subject: [PATCH] [lldb] Replace always-false condition

Signed-off-by: Troy-Butler <squintik at outlook.com>
---
 .../Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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();



More information about the lldb-commits mailing list