Files
zig/lib
Ryan Liptak 71f23402bc Writer: Fix splatBytePreserve losing data in certain cases
In cases where the now removed `preserve < w.end` branch was taken, some of the data in the buffer would never make it to logical sink. For example, in one of the newly added test cases where a buffer of 10 is filled with 9 bytes, and then `splatBytePreserve` is called with a preserve of 5 and a splat of 2, the 5 preserved bytes in the buffer would get memmoved to the front of the buffer in the `preserve < w.end` branch, clobbering the first 4 bytes (without any chance of them making it to the logical sink).

After this commit, `rebase` is called to allow the implementation to do the preservation while sending any relevant bytes to the logical sink in the process.

Addresses part of https://github.com/ziglang/zig/issues/24767
Supersedes https://github.com/ziglang/zig/pull/24875
2026-05-19 03:15:55 +02:00
..
2026-05-18 19:19:18 +02:00