Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[perl #92706] In PerlIO::Scalar::seek, don’t assume SvPOKp
Otherwise we get assertion failures. In fact, since seeking might be just for reading, we can’t coerce and SvGROW either. In fact, since the scalar might be modified between seek and write, there is no *point* in SvGROW during seek, even for SvPOK scalars. PerlIO::scalar assumes in too many places that the scalar it is using is its own private scalar that nothing else can modify. Nothing could be farther from the truth. This commit moves the zero-fill that usually happens when seeking past the end from seek to write. During a write, if the current position is past the end of the string, the intervening bytes are zero-filled at that point, since the seek hasn’t done it.
- Loading branch information
Father Chrysostomos
committed
Jan 6, 2012
1 parent
81104cd
commit b659727
Showing
2 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters