This revision was automatically updated to reflect the committed changes.
pcc marked an inline comment as done.
Closed by commit rL321124: libcxx: Fix for basic_stringbuf::seekoff() after
r320604. (authored by pcc, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41319?vs=1276
mclow.lists accepted this revision.
mclow.lists added a comment.
This revision is now accepted and ready to land.
LGTM. I'm going to sprinkle `const` throughout this file later, but that is a
drive-by thing.
All the lines that start out `ptrdiff_t __hm = ` will soon be `const ptrdiff_t
__hm = `
pcc updated this revision to Diff 127609.
pcc added a comment.
- Make __hm const
https://reviews.llvm.org/D41319
Files:
libcxx/include/sstream
libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp
Index:
libcxx/test/std/input.output/string.streams/str
mclow.lists added inline comments.
Comment at: libcxx/include/sstream:580
return pos_type(-1);
+ptrdiff_t __hm = __hm_ == nullptr ? 0 : __hm_ - __str_.data();
off_type __noff;
This can be const.
https://reviews.llvm.org/D41319
_
pcc created this revision.
pcc added reviewers: EricWF, mclow.lists.
As a result of this change, the basic_stringbuf constructor that
takes a mode ends up leaving __hm_ set to 0, causing the comparison
"__hm_ - __str_.data() < __noff" in seekoff() to succeed, which caused
the function to incorrect