From acd9e032a147f4aa7ad49110dc2f4fb945e7a9bb Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 20:14:04 -0300 Subject: Keep a pane's filesystem state on the Pane instead of a slot-indexed table addr, limit, the event queue and its readers, pty/data's queue, a waiting run and the /log announcement flag lived in p.fs.panes[slot], reset when the pane went; a reused slot is how the bug class came in. acme keeps the same state on its Window (editors/acme/dat.h:226-266), so now Pane.fs holds it: announced, retired (noteRetire, which still answers a waiting run and drops the listener count first) and freed with the pane itself. Co-Authored-By: Claude Opus 5.5 --- src/ninep/addr.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ninep/addr.zig') diff --git a/src/ninep/addr.zig b/src/ninep/addr.zig index 566e2364..e41d306e 100644 --- a/src/ninep/addr.zig +++ b/src/ninep/addr.zig @@ -247,13 +247,13 @@ test "the address language, form by form" { _ = th.wr(p, addr, "1"); _ = th.wr(p, addr, "."); - try testing.expectEqual(@as(u32, 0), p.fs.panes[0].addr.q0); - try testing.expectEqual(@as(u32, 4), p.fs.panes[0].addr.q1); + try testing.expectEqual(@as(u32, 0), p.panes[0].?.fs.addr.q0); + try testing.expectEqual(@as(u32, 4), p.panes[0].?.fs.addr.q1); _ = th.wr(p, addr, "$"); _ = th.wr(p, addr, "?o?"); - try testing.expectEqual(@as(u32, 6), p.fs.panes[0].addr.q0); // the `o` in "two" - try testing.expectEqual(@as(u32, 7), p.fs.panes[0].addr.q1); + try testing.expectEqual(@as(u32, 6), p.panes[0].?.fs.addr.q0); // the `o` in "two" + try testing.expectEqual(@as(u32, 7), p.panes[0].?.fs.addr.q1); // limit is its own file: copying addr onto it bounds the search, and // truncating it lifts the bound again. @@ -264,12 +264,12 @@ test "the address language, form by form" { const pair = th.rd(p, addr, 0, 64).bytes; @memcpy(copied[0..pair.len], pair); _ = th.wr(p, limit, copied[0..pair.len]); - try testing.expectEqual(@as(u32, 4), p.fs.panes[0].limit.?.q1); + try testing.expectEqual(@as(u32, 4), p.panes[0].?.fs.limit.?.q1); try testing.expectEqualStrings(" 0 4 ", th.rd(p, limit, 0, 64).bytes); _ = th.wr(p, addr, "#0"); try testing.expectEqual(E.INVAL, th.wr(p, addr, "/three/").errno()); _ = th.call(p, .{ .tag = 6, .op = .setattr, .node = limit, .truncate = true }); - try testing.expect(p.fs.panes[0].limit == null); + try testing.expect(p.panes[0].?.fs.limit == null); _ = th.wr(p, addr, "#0"); try testing.expectEqual(Status.ok, th.wr(p, addr, "/three/").reply.status); -- cgit v1.3