Author: sebor
Date: Fri May 12 17:44:15 2006
New Revision: 405964
URL: http://svn.apache.org/viewcvs?rev=405964&view=rev
Log:
2006-05-12 Martin Sebor <[EMAIL PROTECTED]>
STDCXX-179
* vector.cc (_C_insert_range): Corrected logic error in the computation
of the end of the range of elements to be overwritten (assigned over).
Modified:
incubator/stdcxx/trunk/include/vector.cc
Modified: incubator/stdcxx/trunk/include/vector.cc
URL:
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/vector.cc?rev=405964&r1=405963&r2=405964&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/vector.cc (original)
+++ incubator/stdcxx/trunk/include/vector.cc Fri May 12 17:44:15 2006
@@ -600,7 +600,7 @@
// compute the beginning of the range of elements whose copies
// will be constructed just past the current end of the sequence
- const pointer __ucpbeg = __self->_C_end - __size2;
+ pointer __ucpbeg = __self->_C_end - __size2;
// construct copies of elements that will be moved beyond
// the current end of the sequence controlled by *this as
@@ -613,15 +613,13 @@
for (__p = __ucpbeg; !(__p == __end); ++__p, ++__self->_C_end)
__self->_C_construct (__self->_C_end, *__p);
- pointer __ucpend = __ucpbeg + (__ucpbeg - __movbeg);
-
// copy elements that will be overwritten below
// over the range of elements moved above as if
// by a call to
- // std::copy_backward (__movbeg, __ucpbeg, __ucpend);
+ // std::copy_backward (__movbeg, __ucpbeg, __movbeg);
for (__p = __ucpbeg; !(__p == __movbeg); ) {
- *--__ucpend = *--__p;
+ *__ucpbeg-- = *--__p;
}
}
else {