<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/89195>89195</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h:89: possible && and || mixup ?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dcb314
      </td>
    </tr>
</table>

<pre>
    Source code analyser cppcheck says:

> trunk/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h:89:11: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
> trunk/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h:91:16: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]

Source code is

    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.");

I think the original coder wanted something like:

    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.");

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVU2PozgQ_TXFpTQRmI_AgUN_LFIOK600PyAydgVq2rGRbbo3_34FmXQyLWXVq5X6MBdjeOVX9fyMS4bAgyVqoXyE8jmRcxydb7Xq86xIeqdP7Xc3e0WonCaUVppTII9qmtRI6gWDPAXIHyB9hvQy5n9g9LN9AdEZo3sQXVg5QHR_mXlgG0B035XnKe5sJD95iuQX9BRHZ0F06-eDVHSNJH1G36HNCPlD3UD-kGWQP-Cb9JbtsEx3mmxkJQ2yteQRxJYPILaonNUc2VnkgNK8yVNYSqUNQvnIl1W7ZdHTJRTK56_X1SySsuprdK3jrc0cbhFERD4giBpENsqwV0aGsLfySAiiAlHhT4CvqveaVbyBwyp27_ofIBqE7eOV-y47iOY2CtFTnL1F5UlG2pP3zq_rxJ8cAtsBz1lwpcCFYgNCLDT5L_nIBPo16cfKP596Z1-lYX1JfUOECxE7K_3pfhk_3z-pbJm5_gep-JHxPO4wjmxfMI6EzvPAVprVUo9v0kbSGNyRlpgBDb_Qhz_3X53ePsH26b7T7_D_c_r3tfi_neH7Tie6zXWTNzKhNttmeZEXeVknY5sVjdCNbJSoy4r6Q9Vvy7pRWVHJtE_FIeFWpKJIi6xOm7LJ6g3lIs2kzkqplK4qDUVKR8lmY8zrceP8kHAIM7V1kzVlYmRPJqydQojzBSiWnuHbJfxbPw8BitRwiOFKEDkaar-kDeDkQuDevN9K0urLuTzy3_OEkHfJ7E07xjitXUt0ILqB4zj3G-WO68X-enl8m7xbDADRrduwFLHuxD8BAAD__5spSwM">