]> granicus.if.org Git - clang/commit
[Analyzer] Iterator Checkers - Make range errors and invalidated access fatal
authorAdam Balogh <adam.balogh@ericsson.com>
Thu, 29 Aug 2019 09:35:47 +0000 (09:35 +0000)
committerAdam Balogh <adam.balogh@ericsson.com>
Thu, 29 Aug 2019 09:35:47 +0000 (09:35 +0000)
commitb5f5bfd1d58daa90e48705103bccd0efe5d18f11
tree28602d8a19fd0cfe1977b74966980997589f5258
parentd83a8c136e1751553e76d2285524fa248fa49dea
[Analyzer] Iterator Checkers - Make range errors and invalidated access fatal

Range errors (dereferencing or incrementing the past-the-end iterator or
decrementing the iterator of the first element of the range) and access of
invalidated iterators lead to undefined behavior. There is no point to
continue the analysis after such an error on the same execution path, but
terminate it by a sink node (fatal error). This also improves the
performance and helps avoiding double reports (e.g. in case of nested
iterators).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370314 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/IteratorChecker.cpp
test/Analysis/Inputs/system-header-simulator-cxx.h
test/Analysis/diagnostics/explicit-suppression.cpp
test/Analysis/invalidated-iterator.cpp
test/Analysis/iterator-range.cpp