| author | |
| committer | |
| log | ffd071f55821f70fbfc59bab172ae07eaf7cde23 |
| tree | 47abd9fb28f7b177586445443edc1475624ee1ac |
| parent | c062c532d7b09b4a593328c486f7fcad70886062 |
memcpy requires non-overlapping arguments.
fifo.realign() handles this case correctly and tries to provide an
optimized implementation.
This probably wasn't hit in practice, as, in a typical usage, fifo's
head is not advanced.1 files changed, 1 insertions(+), 3 deletions(-)
lib/std/process/Child.zig+1-3| ... | ... | @@ -316,9 +316,7 @@ pub const RunResult = struct { |
| 316 | 316 | }; |
| 317 | 317 | |
| 318 | 318 | fn fifoToOwnedArrayList(fifo: *std.io.PollFifo) std.ArrayList(u8) { |
| 319 | if (fifo.head > 0) { | |
| 320 | @memcpy(fifo.buf[0..fifo.count], fifo.buf[fifo.head..][0..fifo.count]); | |
| 321 | } | |
| 319 | if (fifo.head != 0) fifo.realign(); | |
| 322 | 320 | const result = std.ArrayList(u8){ |
| 323 | 321 | .items = fifo.buf[0..fifo.count], |
| 324 | 322 | .capacity = fifo.buf.len, |