[PATCH] ASTVector: Fix return value of various insert() methods
wdietz2 at illinois.edu
Mon Oct 28 15:11:47 PDT 2013
Error caught -fsanitize=pointer-overflow, curiously enough :).
The pointer overflow occurred when insert() was invoked with From==To,
which is done in quite a few places. While std::vector::insert
requires [From,To) to be valid, it looks like here From==To is
intended to be supported, making the bug in the container not in
This patch fixes the overflow when From==To, as well as the return
value in this variant as well as the "fill" variant, changing them to
return an iterator pointing to the first of the inserted elements
(like SmallVector does).
 Patches coming soon.
 See the implementation of append(), for example.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1972 bytes
Desc: not available
More information about the cfe-commits