This is an archive of the discontinued LLVM Phabricator instance.

[clang][Analysis] ExprMutationAnalyzer: break infinite recursion on recursive function call
Needs ReviewPublic

Authored by danix800 on Jul 14 2023, 11:29 AM.

Diff Detail

Event Timeline

danix800 created this revision.Jul 14 2023, 11:29 AM
Herald added a project: Restricted Project. · View Herald Transcript
danix800 requested review of this revision.Jul 14 2023, 11:29 AM
danix800 updated this revision to Diff 542824.Jul 21 2023, 2:24 AM

Apply git-clang-format

PiotrZSL added inline comments.Jul 22 2023, 1:22 AM
clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h
31
NOTE: This memory allocation could be removed by creating class ExprMutationAnalyzerWithHistory that could keep DeclSet as private object and use ExprMutationAnalyzer as base class.
clang/lib/Analysis/ExprMutationAnalyzer.cpp
574

I would assume that Func should be removed from DeclAnalyzed when leaving scope. Otherwise it may not work to good when for example same function would be called twice.