[analyzer] Fix the crash in IteratorChecker.cpp when 'SymbolConjured' has a null...
authorHenry Wong <movietravelcode@outlook.com>
Tue, 20 Mar 2018 09:27:02 +0000 (09:27 +0000)
committerHenry Wong <movietravelcode@outlook.com>
Tue, 20 Mar 2018 09:27:02 +0000 (09:27 +0000)
commit073d5f023c19f3930ef0a5f0c931e1867331d970
tree13784245a035a4617ab04be8219bd6f2184f6a88
parentbf3213e48517f8d6a5123903542d807ef21c0a17
[analyzer] Fix the crash in IteratorChecker.cpp when 'SymbolConjured' has a null Stmt.

When the loop has a null terminator statement and sets 'widen-loops=true', 'invalidateRegions' will constructs the 'SymbolConjured' with null 'Stmt'. And this will lead to a crash in 'IteratorChecker.cpp'. This patch use 'dyn_cast_or_null<>' instead of 'dyn_cast<>' in IteratorChecker.cpp.

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

llvm-svn: 327962
clang/lib/StaticAnalyzer/Checkers/IteratorChecker.cpp
clang/test/Analysis/loop-widening.c