stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: svn commit: r581872 - /incubator/stdcxx/trunk/include/sstream.cc
Date Fri, 05 Oct 2007 03:56:12 GMT
faridz@apache.org wrote:
> Author: faridz
> Date: Thu Oct  4 05:16:24 2007
> New Revision: 581872
> 
> URL: http://svn.apache.org/viewvc?rev=581872&view=rev
> Log:
> 2007-10-04 Farid Zaripov <farid_zaripov@epam.com>
> 
> 	* Merged the head of branches/4.2.0

This change has not been sufficiently tested on trunk.

I don't have time to check the test results or otherwise verify
that the change is okay, and won't until next week, so I'll leave
it up to others to decide whether it should be reverted or if they
feel comfortable with it despite the fact that it hasn't been fully
tested.

In the future, please allow sufficient time to test all changes on
trunk before merging them to the branch. I plan to do another merge
sometime late next week so it might be safest to wait until then.

Martin

> 
> Modified:
>     incubator/stdcxx/trunk/include/sstream.cc
> 
> Modified: incubator/stdcxx/trunk/include/sstream.cc
> URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/sstream.cc?rev=581872&r1=581871&r2=581872&view=diff
> ==============================================================================
> --- incubator/stdcxx/trunk/include/sstream.cc (original)
> +++ incubator/stdcxx/trunk/include/sstream.cc Thu Oct  4 05:16:24 2007
> @@ -185,6 +185,15 @@
>          const _RWSTD_SIZE_T __bufsize =
>              __n + (this->pptr () - this->pbase ());
>  
> +        _RWSTD_PTRDIFF_T __off = -1;
> +
> +        if (this->pbase () <= __s && this->pptr () > __s) {
> +            // __s is a part of the buffer
> +            _RWSTD_ASSERT (this->epptr () >= __s + __n);
> +            // save the offset from pbase()
> +            __off = this->pbase () - __s;
> +        }
> +
>          // preserve current pptr() since str() would seek to end
>          const streamsize __cur = this->pptr () - this->pbase ();
>  
> @@ -196,6 +205,11 @@
>          this->pbump (__cur - (this->pptr () - this->pbase ()));
>  
>          _RWSTD_ASSERT (__n <= this->epptr () - this->pptr ());
> +
> +        if (0 <= __off) {
> +            // correct __s after the buffer reallocation
> +            __s = this->pbase () + __off;
> +        }
>      }
>  
>      // copy the whole string
> 
> 
> 


Mime
View raw message