[PATCH][libcxx] Fix AddressSanitizer false positive with vector::insert

Stefan Haller lists at haller-berlin.de
Wed Jul 1 23:40:55 PDT 2015


Yes, that's true. Thanks, everyone!

Alexey Samsonov <vonosmas at gmail.com> wrote:

> This is obsoleted by http://reviews.llvm.org/D10859, right?
> 
> On Sun, Jun 28, 2015 at 1:06 AM, Stefan Haller <lists at haller-berlin.de> wrote:
> (First-time contributor here; please bear with me in case I'm doing something stupid.)
> 
> Here's a patch that fixes a false positive from AddressSanitizer with vector::insert(pos, first, last). It only triggers when the iterator arguments aren't ForwardIterators, and then only if the vector has a capacity greater than its size.
> 
> The test tries to cover not only the defect case itself (i.e. the first "for" loop of the insert method), but also the second half of the insert method, which was not broken. Not sure if you would prefer a more minimal test that only exercises the bug itself.
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/



More information about the llvm-commits mailing list