Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

DavidSpickett
Copy link
Collaborator

@llvmbot
Copy link
Member

llvmbot commented Jul 25, 2024

@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)

Changes

Reverts llvm/llvm-project#94779

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


Full diff: https://github.com/llvm/llvm-project/pull/100561.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h (+8-9)
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);

@DavidSpickett DavidSpickett merged commit a466db2 into main Jul 25, 2024
6 of 7 checks passed
@DavidSpickett DavidSpickett deleted the revert-94779-fix89195 branch July 25, 2024 12:18
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants