diff options
Diffstat (limited to 'core/dump.zig')
| -rw-r--r-- | core/dump.zig | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/dump.zig b/core/dump.zig index d8d87fc6..a37f46b9 100644 --- a/core/dump.zig +++ b/core/dump.zig @@ -536,12 +536,11 @@ pub fn restore(p: *Pardes, bytes: []const u8, from: []const u8) !*Pardes { pub fn initFromDump(gpa: std.mem.Allocator, opts: Options, bytes: []const u8) !*Pardes { pardes.tape.startFromEnv(); const taped = pardes.tape.enter(null, .{ .init_from_dump = .{ .opts = opts, .bytes = bytes } }); - const p = (if (Handover.carries(gpa, bytes)) carriedWindow(gpa, opts, bytes) else loadAndRevive(gpa, opts, bytes, null, null)) catch |err| { - pardes.tape.leave(null, taped); - return err; - }; - pardes.tape.leave(p, taped); - return p; + // The tape adopts the core made, none on a failure. + var made: ?*Pardes = null; + defer pardes.tape.leave(made, taped); + made = try (if (Handover.carries(gpa, bytes)) carriedWindow(gpa, opts, bytes) else loadAndRevive(gpa, opts, bytes, null, null)); + return made.?; } /// A window of its own for panes a grip carried out of another (Handover): |
