aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-07-11 10:03:54 -0700
committerAndrew Kelley <andrew@ziglang.org>2025-07-14 00:14:21 -0700
commit5496901e713dc1a75de289d7e8e3c79e7fee9510 (patch)
tree269aa691017a66c9256f914b90308447a9a3a77c /lib/std/Build
parent093fe02b75a4a28f7faecea63ce2ae9639ef5b66 (diff)
downloadzig-5496901e713dc1a75de289d7e8e3c79e7fee9510.tar.gz
zig-5496901e713dc1a75de289d7e8e3c79e7fee9510.zip
std.Io.Reader.appendRemaining: add missing assert
Diffstat (limited to 'lib/std/Build')
-rw-r--r--lib/std/Build/Cache.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig
index 826e5db460..9e5ad20f93 100644
--- a/lib/std/Build/Cache.zig
+++ b/lib/std/Build/Cache.zig
@@ -661,7 +661,8 @@ pub const Manifest = struct {
} {
const gpa = self.cache.gpa;
const input_file_count = self.files.entries.len;
- var manifest_reader = self.manifest_file.?.reader(&.{}); // Reads positionally from zero.
+ var tiny_buffer: [1]u8 = undefined; // allows allocRemaining to detect limit exceeded
+ var manifest_reader = self.manifest_file.?.reader(&tiny_buffer); // Reads positionally from zero.
const limit: std.io.Limit = .limited(manifest_file_size_max);
const file_contents = manifest_reader.interface.allocRemaining(gpa, limit) catch |err| switch (err) {
error.OutOfMemory => return error.OutOfMemory,