[libcxx] r222014 - [libcxx] Fix vector annotator size increase in `vector::insert(pos, count, value)`
Eric Fiselier
eric at efcs.ca
Fri Nov 14 10:28:36 PST 2014
Author: ericwf
Date: Fri Nov 14 12:28:36 2014
New Revision: 222014
URL: http://llvm.org/viewvc/llvm-project?rev=222014&view=rev
Log:
[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
Modified:
libcxx/trunk/include/vector
Modified: libcxx/trunk/include/vector
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/vector?rev=222014&r1=222013&r2=222014&view=diff
==============================================================================
--- libcxx/trunk/include/vector (original)
+++ libcxx/trunk/include/vector Fri Nov 14 12:28:36 2014
@@ -1861,7 +1861,7 @@ vector<_Tp, _Allocator>::insert(const_it
}
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);
More information about the cfe-commits
mailing list