diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2017-09-12 15:00:43 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2017-09-12 15:00:43 +0000 |
commit | 29149d3e3565813dcf8b9adc895a6a39eeccdd09 (patch) | |
tree | 69559651ab6f3567b5404f1dfcf63a9b467b79f9 /src | |
parent | 60f8ad1b1dbfa6673919bbf3e7e629997224651d (diff) |
Make pbump (internally) handle sizes bigger than MAX_INT. Fixes PR#33725 - thanks to Jonathan Wakely for the report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src')
-rw-r--r-- | src/strstream.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/strstream.cpp b/src/strstream.cpp index 01523cf45..8b8521f76 100644 --- a/src/strstream.cpp +++ b/src/strstream.cpp @@ -186,7 +186,7 @@ strstreambuf::overflow(int_type __c) } setg(buf, buf + ninp, buf + einp); setp(buf + einp, buf + new_size); - pbump(static_cast<int>(nout)); + __pbump(nout); __strmode_ |= __allocated; } *pptr() = static_cast<char>(__c); @@ -282,7 +282,7 @@ strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmod // min(pbase, newpos), newpos, epptr() __off = epptr() - newpos; setp(min(pbase(), newpos), epptr()); - pbump(static_cast<int>((epptr() - pbase()) - __off)); + __pbump((epptr() - pbase()) - __off); } __p = newoff; } @@ -312,7 +312,7 @@ strstreambuf::seekpos(pos_type __sp, ios_base::openmode __which) // min(pbase, newpos), newpos, epptr() off_type temp = epptr() - newpos; setp(min(pbase(), newpos), epptr()); - pbump(static_cast<int>((epptr() - pbase()) - temp)); + __pbump((epptr() - pbase()) - temp); } __p = newoff; } |