llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Shivam Gupta (xgupta)

<details>
<summary>Changes</summary>

Source code analyser cppcheck says:
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h:89:11:
 warning: Identical inner 'if' condition is always true. 
[identicalInnerCondition]
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h:91:16:
 warning: Identical inner 'if' condition is always true. 
[identicalInnerCondition]

Fix #<!-- -->89195

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


1 Files Affected:

- (modified) 
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
 (+1-1) 


``````````diff
diff --git 
a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
 
b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
index 163659234466d..30811639c9a95 100644
--- 
a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
+++ 
b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
@@ -85,7 +85,7 @@ 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 && !has_interpreter_dict && !script_obj) {
+    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)

``````````

</details>


https://github.com/llvm/llvm-project/pull/94779
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to