[PATCH] D86964: [ASTMatchers] Avoid recursion in ancestor matching to save stack space.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 1 11:24:42 PDT 2020


sammccall created this revision.
sammccall added a reviewer: hokein.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
sammccall requested review of this revision.

A recent change increased the stack size of memoizedMatchesAncestorOfRecursively
leading to stack overflows on real code involving large fold expressions.
It's not totally unreasonable to choke on very deep ASTs, but as common
infrastructure it's be nice if ASTMatchFinder is more robust.
(It already uses data recursion for the regular "downward" traversal.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86964

Files:
  clang/lib/ASTMatchers/ASTMatchFinder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86964.289232.patch
Type: text/x-patch
Size: 8837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200901/fe2ce75c/attachment-0001.bin>


More information about the cfe-commits mailing list