[cfe-dev] Iterator as SVal

Ádám Balogh via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 25 09:02:55 PST 2016


Hello,

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.

However, I am curious why iterators are handled as value objects unlike other complex types. Is there a specific reason for that? Is it not possible to change this behavior? Would it break something in Clang? Where are iterators recognized and distinguished from other C++ complex types? In Clang or LLVM? What types are considered as iterators: only std:: iterators, types having suffix "iterator" in their names or types having the usual member types (the types defined in std::iterator_traits)?

Regards,

Ádám

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160225/68c9f858/attachment.html>


More information about the cfe-dev mailing list