From b9987293e60e7b327628169dbf388111751ebf75 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 14 Nov 2014 18:28:36 +0000 Subject: [PATCH] [libcxx] Fix vector annotator size increase in `vector::insert(pos, count, value)` Summary: The size of the vector is being increased by `__n` during the call to `__move_range` and not by 1. This fixes a test failure in `containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp` when using ASAN. Reviewers: danalbert, kcc, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6264 llvm-svn: 222014 --- libcxx/include/vector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/include/vector b/libcxx/include/vector index cd9aab324653..22a63439a763 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -1861,7 +1861,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_ } if (__n > 0) { - __RAII_IncreaseAnnotator __annotator(*this); + __RAII_IncreaseAnnotator __annotator(*this, __n); __move_range(__p, __old_last, __p + __old_n); __annotator.__done(); const_pointer __xr = pointer_traits::pointer_to(__x);