<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - ASTMatchers cause crash through an assertion"
   href="https://bugs.llvm.org/show_bug.cgi?id=40175">40175</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ASTMatchers cause crash through an assertion
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>development@jonas-toth.eu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

the newly introduced capabilities to limit the traversal-scope for the AST
Matchers triggers crashes for certain traversals. The revision introducing this
behaviour is <a href="https://reviews.llvm.org/D54309#1320628">https://reviews.llvm.org/D54309#1320628</a>.

This bug: <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - abseil-upgrade-duration-conversions triggers assertion in MatchASTVisitor::matchesAncestorOfRecursively"
   href="show_bug.cgi?id=39949">https://bugs.llvm.org/show_bug.cgi?id=39949</a>
seems to come from the same underlying issue.

To reproduce the problem locally you can add this test-case
(<a href="https://github.com/JonasToth/clang/blob/fix_crash/unittests/Analysis/ExprMutationAnalyzerTest.cpp#L1134">https://github.com/JonasToth/clang/blob/fix_crash/unittests/Analysis/ExprMutationAnalyzerTest.cpp#L1134</a>)
to your local clang. It was the minimal case I could create to show the
behaviour. It relies on the `ExprMutAnalyzer` to trigger the problem while
doing its analysis.

Removing the assertion (ASTMatchFinder.cpp L.680) "fixed" the problem in the
sense that the analysis succeeded and no other defects were visible. But that
is the case for the (old) full AST-Traversal and might differ in limited scope.

Given the condition manifests in an implemented check already we should work
that out before the 8.0 release, in my opinion.

Best, Jonas</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>