[PATCH] D32845: [Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 31 06:21:01 PDT 2018


baloghadamsoftware updated this revision to Diff 163517.
baloghadamsoftware removed a reviewer: george.karpenkov.
baloghadamsoftware added a comment.
Herald added a reviewer: george.karpenkov.

Since https://reviews.llvm.org/rL338263 fixed a bug in the cleanup phase the tests for mismatched iterator checker did not pass. The reason for this is that the region of some `LazyCompoundVal`s are cleaned up while there are still iterator positions connected to the `LazyCompoundVal` itself. This happens typically for arguments which are constructed in-place (e.g. `begin()` or `end()` of a container is invoked in the argument itself).

We applied a fix here that defers cleanup of such iterator positions. No other solution comes to my mind at the moment.

I wanted to upload this fix in a separate patch but I could not create tests for it.

@NoQ please review this fix before I commit the patch.


https://reviews.llvm.org/D32845

Files:
  include/clang/StaticAnalyzer/Checkers/Checkers.td
  lib/StaticAnalyzer/Checkers/IteratorChecker.cpp
  test/Analysis/Inputs/system-header-simulator-cxx.h
  test/Analysis/invalidated-iterator.cpp
  test/Analysis/mismatched-iterator.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32845.163517.patch
Type: text/x-patch
Size: 12725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180831/d9d2405b/attachment-0001.bin>


More information about the cfe-commits mailing list