From 30b41dc51015c1ed8fa4a7c4f2c61e2a6206ff55 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 14 Aug 2025 20:34:44 -0700 Subject: std.compress.zstd.Decompress fixes * std.Io.Reader: appendRemaining no longer supports alignment and has different rules about how exceeding limit. Fixed bug where it would return success instead of error.StreamTooLong like it was supposed to. * std.Io.Reader: simplify appendRemaining and appendRemainingUnlimited to be implemented based on std.Io.Writer.Allocating * std.Io.Writer: introduce unreachableRebase * std.Io.Writer: remove minimum_unused_capacity from Allocating. maybe that flexibility could have been handy, but let's see if anyone actually needs it. The field is redundant with the superlinear growth of ArrayList capacity. * std.Io.Writer: growingRebase also ensures total capacity on the preserve parameter, making it no longer necessary to do ensureTotalCapacity at the usage site of decompression streams. * std.compress.flate.Decompress: fix rebase not taking into account seek * std.compress.zstd.Decompress: split into "direct" and "indirect" usage patterns depending on whether a buffer is provided to init, matching how flate works. Remove some overzealous asserts that prevented buffer expansion from within rebase implementation. * std.zig: fix readSourceFileToAlloc returning an overaligned slice which was difficult to free correctly. fixes #24608 --- lib/std/debug/Dwarf.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/debug/Dwarf.zig') diff --git a/lib/std/debug/Dwarf.zig b/lib/std/debug/Dwarf.zig index 2cdeede7b1..01c672b3a0 100644 --- a/lib/std/debug/Dwarf.zig +++ b/lib/std/debug/Dwarf.zig @@ -2247,7 +2247,7 @@ pub const ElfModule = struct { var decompress: std.compress.flate.Decompress = .init(§ion_reader, .zlib, &.{}); var decompressed_section: ArrayList(u8) = .empty; defer decompressed_section.deinit(gpa); - decompress.reader.appendRemainingUnlimited(gpa, null, &decompressed_section, std.compress.flate.history_len) catch { + decompress.reader.appendRemainingUnlimited(gpa, &decompressed_section) catch { invalidDebugInfoDetected(); continue; }; -- cgit v1.2.3