]> granicus.if.org Git - clang/commit
[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)
commit167b1f1859885d01c4bb71f63e56405b3321ab45
tree509bdb84daae9a750fe326c7c5270a5dc0cf3613
parent73fed20ccfe3c439d8568756463c79a032e7c9e0
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327962 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/IteratorChecker.cpp
test/Analysis/loop-widening.c