It's probably worth to refactor a machinery for finding a path to a particular region from a particular region into a common subroutine.
rdar://39701823
Paths
| Differential D49901
[analyzer] Extend NoStoreFuncVisitor to recursively follow fields ClosedPublic Authored by george.karpenkov on Jul 26 2018, 7:19 PM.
Details Summary It's probably worth to refactor a machinery for finding a path to a particular region from a particular region into a common subroutine. rdar://39701823
Diff Detail Event TimelineHerald added subscribers: mikhail.ramalho, a.sidorin, szepet and 2 others. · View Herald TranscriptJul 26 2018, 7:19 PM george.karpenkov added parent revisions: D49772: [analyzer] [NFC] Simplify some visitors by giving a convenient getter from state to analysis manager, D49701: [ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration.Jul 26 2018, 7:19 PM george.karpenkov added a parent revision: D49689: [analyzer] Extend NoStoreFuncVisitor to insert a note on IVars. george.karpenkov edited parent revisions, added: D49951: [AST] [NFC] Add a convenient getter from QualType to RecordDecl; removed: D49689: [analyzer] Extend NoStoreFuncVisitor to insert a note on IVars, D49701: [ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration.Jul 27 2018, 6:31 PM george.karpenkov added inline comments.
Comment Actions Looks great! Marking as "requested changes" as per repeated requests from the working class.
This revision now requires changes to proceed.Jul 30 2018, 4:13 PM george.karpenkov marked 4 inline comments as done. This revision now requires changes to proceed.Jul 30 2018, 6:14 PM Comment Actions Is something like this worth adding to the C++ test file? struct HasRefToItself { HasRefToItself &Ref; // no infinite loop int &z; HasRefToItself(int &z) : Ref(*this), z(z) {} }; Maybe a list-like struct that has a cycle?
Comment Actions
We limit the recursion depth to 1 for fields, so it won't dereference fields more than once. It could be still worthwhile to have this test to make sure this condition does not break.
This revision is now accepted and ready to land.Aug 1 2018, 5:32 PM Closed by commit rL338667: [analyzer] Extend NoStoreFuncVisitor to follow fields. (authored by george.karpenkov). · Explain WhyAug 1 2018, 7:03 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 157636 clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
clang/test/Analysis/diagnostics/no-store-func-path-notes.cpp
|
This would need a rebase after an update to D49772.