<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 --- - Wrongly detected Called C++ object pointer is null for QModelIndex"
   href="https://llvm.org/bugs/show_bug.cgi?id=31304">31304</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrongly detected Called C++ object pointer is null for QModelIndex
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.9
          </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>xiangzhai83@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi llvm developers,

Clang Static Analyzer consider: 

QModelIndex firstColIndex = index.model()->index(index.row(), 0,
index.parent());
might Called C++ object pointer is null

*BUT* let's see the code about line 14:

Node* Node::createNodeForOriginalIndex( const QModelIndex& index )             
    {                                                                           
        if ( !index.isValid() && isPlace() ) {                                  
            return this;                                                        
        }                                                                       

        Q_ASSERT( index.isValid() );                                            

        // all the node mapping is done on the first col, so make sure we use   
        // an index on the first col                                            
        //                                                                      
        // A valid index belongs to a model, and has non-negative row and
column numbers
        // so index.model() is NOT nullptr if index.isValid()                   
---> QModelIndex firstColIndex = index.model()->index(index.row(), 0,
index.parent());
        Node* node = findNodeForOriginalIndex( firstColIndex );                 
        if ( !node ) {                                                          
            Node* parentNode = createNodeForOriginalIndex(
firstColIndex.parent() );
            node = parentNode->getChildNode( firstColIndex );                   
        }                                                                       

        return node;                                                            
    }

It might be a wrong detect!

Regards,
Leslie Zhai</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>