forked from OSchip/llvm-project
[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
This commit is contained in:
parent
05d50a9645
commit
b9987293e6
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue