[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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222014 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2014-11-14 18:28:36 +00:00
parent 1c3b15d339
commit d759095887

View File

@@ -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<const_pointer>::pointer_to(__x);