We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
take!
pushfirst!
Here is a MWE:
julia> b = pushfirst!([0x02], 0x01) 2-element Vector{UInt8}: 0x01 0x02 julia> take!(IOBuffer(b)) 5-element Vector{UInt8}: 0x01 0x02 0x69 0x73 0x69
julia> versioninfo() Julia Version 1.12.0-DEV.347 Commit c0611e8c49c (2024-04-15 17:22 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 16 × AMD Ryzen 7 7800X3D 8-Core Processor WORD_SIZE: 64 LLVM: libLLVM-16.0.6 (ORCJIT, znver4) Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)
I think the issue is
julia/base/iobuffer.jl
Line 461 in d8b9810
StringVector(io.size)
StringVector(nbytes)
The pushfirst! causes the IOBuffer to have a nonzero offset field (added in #53192) which makes nbytes and io.size different.
IOBuffer
offset
nbytes
io.size
The text was updated successfully, but these errors were encountered:
Technically, it's not reading garbage values, but rather, nothing is written to the trailing io.size - nbytes values allocated by StringVector.
io.size - nbytes
StringVector
Sorry, something went wrong.
I made a PR to get the ball rolling (#54129).
use correct size when creating output data from an IOBuffer (#54129)
fda02ac
PR from #54097. Fixes #54097 Co-authored-by: Nathan Zimmerberg
9b5f3c9
PR from #54097. Fixes #54097 Co-authored-by: Nathan Zimmerberg (cherry picked from commit fda02ac)
Successfully merging a pull request may close this issue.
Here is a MWE:
I think the issue is
julia/base/iobuffer.jl
Line 461 in d8b9810
using
StringVector(io.size)
instead ofStringVector(nbytes)
.The
pushfirst!
causes theIOBuffer
to have a nonzerooffset
field (added in #53192) which makesnbytes
andio.size
different.The text was updated successfully, but these errors were encountered: