This patch adds support for the following operations in the iterator checkers: push_back, push_front, emplace_back, emplace_front, pop_back and pop_front. This affects iterator range checks (range is extended after push and emplace and reduced after pop operations) and invalidation checks (according to the standard).
Details
Details
- Reviewers
NoQ george.karpenkov dcoughlin - Commits
- rG9a48ba6b4aa3: [Analyzer] Iterator Checker - Part 7: Support for push and pop operations
rC341793: [Analyzer] Iterator Checker - Part 7: Support for push and pop operations
rL341793: [Analyzer] Iterator Checker - Part 7: Support for push and pop operations
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This looks clear to me.
lib/StaticAnalyzer/Checkers/IteratorChecker.cpp | ||
---|---|---|
1623–1638 | Would getDynamicTypeInfo() be of any help? |
Comment Actions
Rebased to Part6. Also fixed a test failing now: it is not enough to mark the symbolic expressions as live, but if it is a SymIntExpr (it can be nothing else, except SymbolConjured), we also have to mark the left side of it (which is always SymbolConjured) as live. Using scanReachableSymbols() here would be too heavyweight.
I guess we should think if we want to use CallDescription for these when D48027 lands.