From af8445e9ce4d9bd74775a68b694957640f29d28a Mon Sep 17 00:00:00 2001 From: Troy Butler <118708570+Troy-Butler@users.noreply.github.com> Date: Mon, 22 Apr 2024 23:17:51 -0400 Subject: [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 Co-authored-by: Troy-Butler --- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp') 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 python::As(Expected &&obj) { if (!obj) return obj.takeError(); PyObject *str_obj = PyObject_Str(obj.get().get()); - if (!obj) + if (!str_obj) return llvm::make_error(); auto str = Take(str_obj); auto utf8 = str.AsUTF8(); -- cgit v1.1