[all-commits] [llvm/llvm-project] f5cb9c: [ASTMatchers] Fix classIsDerivedFrom for recusrive...

Ilya Biryukov via All-commits all-commits at lists.llvm.org
Mon Sep 25 03:10:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5cb9cb59d7c9c6ac3d5c41c677f68c9b75d34a3
      https://github.com/llvm/llvm-project/commit/f5cb9cb59d7c9c6ac3d5c41c677f68c9b75d34a3
  Author: Ilya Biryukov <ibiryukov at google.com>
  Date:   2023-09-25 (Mon, 25 Sep 2023)

  Changed paths:
    M clang/lib/ASTMatchers/ASTMatchFinder.cpp
    M clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp

  Log Message:
  -----------
  [ASTMatchers] Fix classIsDerivedFrom for recusrive cases (#67307)

By ensuring the base is only visited once. This avoids infinite
recursion and expontential running times in some corner cases.

See the added tests for examples.

Apart from the cases that caused infinite recursion and used to crash,
this change is an NFC and results of the matchers are the same.




More information about the All-commits mailing list