<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW " title="NEW --- - false positive due to ignoring nonwritten value" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23693&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=dRPfivqbqEhZHal5YWze9TR4v-wjDA0eWFMNM3HryWI&s=D_wJI8EXbQe3-mf9Mv0LpjTxd0vRvc0jASmeSqg5rNQ&e=">23693</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>false positive due to ignoring nonwritten value
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rgerhards@hq.adiscon.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14403" name="attach_14403" title="Report">attachment 14403</a> <a href="attachment.cgi?id=14403&action=edit" title="Report">[details]</a></span>
Report

I have banged my head over this one for quite a while. I think it either is a
false positive ... or the construct is too complex for static analysis.

Have a look at the attached report. Keep an eye on variable
"expr->r->nodetype". Between points 2 and 7, it never is written. However, the
analyzer assumes in step 3 that it's value is 'A' but in step 6 it assumes it
has changed to not 'A'. The only place where it could potentially have been
written is in line 2285, as part of the function call. And, indeed, if I
comment out that line, the report goes away. 

Note that evalStrArrayCmp() never writes the expr->r parameter. If I change the
prototype to explicitely make expt->r const, the warning goes away. So it looks
the static analyzer now unerstands that the value cannot change.

Question now: is this a bug or an inherant limit in static analysis?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>