You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2007/10/04 14:16:24 UTC

svn commit: r581872 - /incubator/stdcxx/trunk/include/sstream.cc

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 <fa...@epam.com>

	* Merged the head of branches/4.2.0

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



Re: svn commit: r581872 - /incubator/stdcxx/trunk/include/sstream.cc

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
>> Sent: Friday, October 05, 2007 6:56 AM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: svn commit: r581872 - 
>> /incubator/stdcxx/trunk/include/sstream.cc
>>
>> 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 <fa...@epam.com>
>>>
>>> 	* Merged the head of branches/4.2.0
>> This change has not been sufficiently tested on trunk.
> 
>   This change was introduced in r553931 (6 Jul 2007),
> then reverted in r564213 (9 Aug 2007) for the JIRA
> issue be created and commit as fix of this JIRA issue.
> 
>   So this change was tested ~ one month.

Great, thanks for the clarification.

Martin

> 
> Farid.
> 


RE: svn commit: r581872 - /incubator/stdcxx/trunk/include/sstream.cc

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
> Sent: Friday, October 05, 2007 6:56 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: svn commit: r581872 - 
> /incubator/stdcxx/trunk/include/sstream.cc
> 
> 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 <fa...@epam.com>
> > 
> > 	* Merged the head of branches/4.2.0
> 
> This change has not been sufficiently tested on trunk.

  This change was introduced in r553931 (6 Jul 2007),
then reverted in r564213 (9 Aug 2007) for the JIRA
issue be created and commit as fix of this JIRA issue.

  So this change was tested ~ one month.

Farid.

Re: svn commit: r581872 - /incubator/stdcxx/trunk/include/sstream.cc

Posted by Martin Sebor <se...@roguewave.com>.
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 <fa...@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
> 
> 
>