[PATCH] D75698: [analyzer][WIP] Suppress bug reports where a tracked expression's latest value change was a result of an invalidation

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 10:23:02 PST 2020


Szelethus created this revision.
Szelethus added reviewers: NoQ, baloghadamsoftware, xazax.hun, rnkovacs, dcoughlin, martong, balazske.
Szelethus added a project: clang.
Herald added subscribers: cfe-commits, danielkiss, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, kristof.beyls, whisperity, mgorny.

You may be familiar with reports that are demonstrated in the test file -- While invalidation is a fundamental part of static analysis, it is unfortunately not an under-approximation (resulting in fewer but more precise paths of execution). Invalidation are often incorrect, so this patch attempts to suppress reports where a tracked expression's last value change was a result of an invalidation.

This is solved by a adding a new checker that notes which regions at which `ProgramPoint` were invalidated, and adding a new `BugReporterVisitor` to the army of `trackExpressionValue` related visitors that looks for the last value change, and suppresses the report if it was a previously noted invalidation.

The big scare in such changes is always whether we would suppress so many things, so this patch says little without results. I'll share some as soon as I have them :)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75698

Files:
  clang/include/clang/Analysis/ProgramPoint.h
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
  clang/lib/Analysis/ProgramPoint.cpp
  clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
  clang/lib/StaticAnalyzer/Checkers/SuppressInvalidationRelatedReports.cpp
  clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
  clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
  clang/test/Analysis/analyzer-enabled-checkers.c
  clang/test/Analysis/suppress-invalidation-related-reports.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75698.248530.patch
Type: text/x-patch
Size: 17401 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200305/5d1ebdd6/attachment-0001.bin>


More information about the cfe-commits mailing list