summaryrefslogtreecommitdiff
path: root/core/tape.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/tape.zig')
-rw-r--r--core/tape.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/tape.zig b/core/tape.zig
index 19fdccd1..dc80887c 100644
--- a/core/tape.zig
+++ b/core/tape.zig
@@ -475,7 +475,7 @@ pub const Tape = struct {
for (t.files.items) |f| if (std.mem.eql(u8, &f.hash, hash)) return f.bytes;
const path = t.reading orelse return null;
if (!t.local_files or !is_path) return null;
- const file = pardes.filesystem.readHost(t.gpa, path, pardes.memory.limits.max_file_bytes) catch return null;
+ const file = pardes.filesystem.readHost(t.io, t.gpa, path, pardes.memory.limits.max_file_bytes) catch return null;
defer t.gpa.free(file);
// The answer as `record` wrote it: an error union's yes, a length, the bytes.
const bytes = t.gpa.alloc(u8, 9 + file.len) catch return null;
@@ -607,6 +607,9 @@ pub const Tape = struct {
fn dumpRoundTrip(t: *Tape, p: *Pardes) void {
on = null;
defer on = t;
+ // The core's own tape aside too: the dump's reads are no input.
+ p.tape = &none;
+ defer p.tape = t;
const bytes = pardes.dump.dumpBytes(p) catch |err| return t.diverge("dump failed: {t}", .{err});
defer t.gpa.free(bytes);
var notes: std.ArrayList(u8) = .empty;