[Lldb-commits] [lldb] Revert "[lldb] Fix incorrect logical operator in 'if' condition check (NFC)" (PR #100561)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 25 05:17:48 PDT 2024


https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/100561

Reverts llvm/llvm-project#94779

Due to bot failures: https://lab.llvm.org/buildbot/#/builders/18/builds/1371

>From b85152008f41e8136f5e21db875a63b464f8c10f Mon Sep 17 00:00:00 2001
From: David Spickett <spickettdavid at googlemail.com>
Date: Thu, 25 Jul 2024 13:16:55 +0100
Subject: [PATCH] =?UTF-8?q?Revert=20"[lldb]=20Fix=20incorrect=20uses=20of?=
 =?UTF-8?q?=20logical=20operator=20in=20'if'=20condition=20check=E2=80=A6"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit 2ba3fe7356f065757a2279f65e4ef5c8f1476293.
---
 .../Python/Interfaces/ScriptedPythonInterface.h | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
index 2667f73516ba3..e1a3156d10afd 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
@@ -85,15 +85,14 @@ class ScriptedPythonInterface : virtual public ScriptedInterface {
     bool has_class_name = !class_name.empty();
     bool has_interpreter_dict =
         !(llvm::StringRef(m_interpreter.GetDictionaryName()).empty());
-
-    if (!has_class_name)
-      return create_error("Missing script class name.");
-
-    if (!has_interpreter_dict)
-      return create_error("Invalid script interpreter dictionary.");
-
-    if (!script_obj)
-      return create_error("Missing scripting object.");
+    if (!has_class_name && !has_interpreter_dict && !script_obj) {
+      if (!has_class_name)
+        return create_error("Missing script class name.");
+      else if (!has_interpreter_dict)
+        return create_error("Invalid script interpreter dictionary.");
+      else
+        return create_error("Missing scripting object.");
+    }
 
     Locker py_lock(&m_interpreter, Locker::AcquireLock | Locker::NoSTDIN,
                    Locker::FreeLock);



More information about the lldb-commits mailing list