aboutsummaryrefslogtreecommitdiff
path: root/lib/std/BitStack.zig
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2025-10-17 16:38:03 -0700
committerRyan Liptak <squeek502@hotmail.com>2025-11-21 22:34:55 -0800
commit21f9f378f165a762059f12bc3d789c731037c8b6 (patch)
treee29842646e88a4082df650cb10a4df8fa71803c5 /lib/std/BitStack.zig
parent2ea55d7153b9832e7f00c8a85ca4941ccde6b0d6 (diff)
downloadzig-21f9f378f165a762059f12bc3d789c731037c8b6.tar.gz
zig-21f9f378f165a762059f12bc3d789c731037c8b6.zip
Reader.defaultDiscard: Fix for use with an indirect reader
If a Reader implementation implements `stream` by ignoring the Writer, writing directly to its internal buffer, and returning 0, then `defaultDiscard` would not update `seek` and also return 0, which is incorrect and can cause `discardShort` to violate the contract of `VTable.discard` by calling into `vtable.discard` with a non-empty buffer. This commit fixes the problem by advancing seek up to the limit after the stream call. This logic could likely be somewhat simplified in the future depending on how #25170 is resolved.
Diffstat (limited to 'lib/std/BitStack.zig')
0 files changed, 0 insertions, 0 deletions