mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-23 09:26:15 +03:00
71f23402bc
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