]> granicus.if.org Git - clang/commit
[analyzer] Improve suppress-on-sink behavior in incomplete analyses.
authorArtem Dergachev <artem.dergachev@gmail.com>
Thu, 22 Dec 2016 14:48:52 +0000 (14:48 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Thu, 22 Dec 2016 14:48:52 +0000 (14:48 +0000)
commit75940dca3962f2509266ca87886cbaf4ca7102b3
tree690ebf5faad49b87e18af7e5215f019f27919db1
parent9ae7d31164cea35354b602e996a1fb905ebfe159
[analyzer] Improve suppress-on-sink behavior in incomplete analyses.

Warnings with suppress-on-sink are discarded during FlushReports when
BugReporter notices that all paths in ExplodedGraph that pass through the
warning eventually run into a sink node.

However, suppress-on-sink fails to filter out false positives when the analysis
terminates too early - by running into analyzer limits, such as block count
limits or graph size limits - and the interruption hits the narrow window
between throwing the leak report and reaching the no-return function call. In
such case the report is there, however suppression-on-sink doesn't work, because
the sink node was never constructed in the incomplete ExplodedGraph.

This patch implements a very partial solution: also suppress reports thrown
against a statement-node that corresponds to a statement that belongs to a
no-return block of the CFG.

rdar://problem/28832541

Differential Revision: https://reviews.llvm.org/D28023

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290341 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/BugReporter.cpp
test/Analysis/max-nodes-suppress-on-sink.c [new file with mode: 0644]