]> granicus.if.org Git - clang/commit
[analyzer] Prevent AnalyzerStatsChecker from crash
authorPeter Szecsi <szepet95@gmail.com>
Wed, 21 Feb 2018 16:06:56 +0000 (16:06 +0000)
committerPeter Szecsi <szepet95@gmail.com>
Wed, 21 Feb 2018 16:06:56 +0000 (16:06 +0000)
commit2014a3637b1cb162255a4fd4dafd3a70fc71deae
treeb87af88183093e2907d263f1396ebae3aba6dbb0
parent1ed3896b662bc9f3ab7b33db645fa92272e74a1a
[analyzer] Prevent AnalyzerStatsChecker from crash

The checker marks the locations where the analyzer creates sinks. However, it
can happen that the sink was created because of a loop which does not contain
condition statement, only breaks in the body. The exhausted block is the block
which should contain the condition but empty, in this case.
This change only emits this marking in order to avoid the undefined behavior.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325693 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp
test/Analysis/analyzer-stats.c