<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Feb 25, 2016, at 9:02 AM, Ádám Balogh via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><br class=""></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I created a simple checker that tries to check whether an iterator is possibly used outside of its valid range (it equals to end()). However, it does not work, of course, since it turned out that iterators are not symbolic but value objects. I read this information in the archive of this list. There I read two suggestions: either to implement tracking of value objects in the Clang infrastructure (very much effort needed) or to do some hacking.</div></div></div></blockquote><div><br class=""></div>Anna Zaks started work on something similar several years ago. The basic approach was to create a callback which gets triggered on object copy(copy or move constructor). The idea is that we start tracking an iterator when it gets returned by begin() and monitor each time a copy is created. I’ve attached a very old patch of Anna’s that modifies the core and the beginnings of a new checker that she started working on, if you are interested in pursuing this.<div class=""><br class=""></div><div class="">One thing to note is that we’re not entirely sure whether this is right approach — it was just an initial exploration.</div><div class=""><br class=""></div><div class="">Devin</div><div class=""><br class=""></div><div class=""></div></div></div></body></html>