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 incorrectly return -1. The fix is to account for the
possibility of hm_ being 0 when computing the distance from hm_
to the start of the string.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
libcxx/include/sstream | ||
---|---|---|
580 ↗ | (On Diff #127226) | This can be const. |
Comment Actions
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 = ,
but that's not necessary for this bug fix.