[all-commits] [llvm/llvm-project] 2ba3fe: [lldb] Fix incorrect uses of logical operator in '...

Shivam Gupta via All-commits all-commits at lists.llvm.org
Thu Jul 25 04:30:00 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ba3fe7356f065757a2279f65e4ef5c8f1476293
      https://github.com/llvm/llvm-project/commit/2ba3fe7356f065757a2279f65e4ef5c8f1476293
  Author: Shivam Gupta <shivam98.tkg at gmail.com>
  Date:   2024-07-25 (Thu, 25 Jul 2024)

  Changed paths:
    M lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h

  Log Message:
  -----------
  [lldb] Fix incorrect uses of logical operator in 'if' condition check (NFC) (#94779)

The condition checking for missing class name, interpreter dictionary,
and script object incorrectly used logical AND (&&), which could never
be true to enter the 'if' block.

This commit uses separate if conditions for each class name, interpreter
dictionary, and script object.

Cought by cppcheck -

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

---------

Co-authored-by: Shivam Gupta <shivma98.tkg at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list