[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)
commit5184fae04e4c3768bb2d47f015026c134c0174ee
tree497babcee18ec00acaeadf2fd56792bc05d484e8
parent36362692b39f15fb3ced43c8f94c3542075c2da9
[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

llvm-svn: 325693
clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp
clang/test/Analysis/analyzer-stats.c