| ... | @@ -3,7 +3,7 @@ const Archive = @This(); | ... | @@ -3,7 +3,7 @@ const Archive = @This(); |
| 3 | const std = @import("std"); | 3 | const std = @import("std"); |
| 4 | const assert = std.debug.assert; | 4 | const assert = std.debug.assert; |
| 5 | const fs = std.fs; | 5 | const fs = std.fs; |
| 6 | const log = std.log.scoped(.macho); | 6 | const log = std.log.scoped(.link); |
| 7 | const macho = std.macho; | 7 | const macho = std.macho; |
| 8 | const mem = std.mem; | 8 | const mem = std.mem; |
| 9 | | 9 | |
| ... | @@ -88,6 +88,7 @@ const ar_hdr = extern struct { | ... | @@ -88,6 +88,7 @@ const ar_hdr = extern struct { |
| 88 | }; | 88 | }; |
| 89 | | 89 | |
| 90 | pub fn deinit(self: *Archive, allocator: Allocator) void { | 90 | pub fn deinit(self: *Archive, allocator: Allocator) void { |
| | 91 | self.file.close(); |
| 91 | for (self.toc.keys()) |*key| { | 92 | for (self.toc.keys()) |*key| { |
| 92 | allocator.free(key.*); | 93 | allocator.free(key.*); |
| 93 | } | 94 | } |
| ... | @@ -217,7 +218,7 @@ pub fn parseObject( | ... | @@ -217,7 +218,7 @@ pub fn parseObject( |
| 217 | const contents = try gpa.allocWithOptions(u8, object_size, @alignOf(u64), null); | 218 | const contents = try gpa.allocWithOptions(u8, object_size, @alignOf(u64), null); |
| 218 | const amt = try reader.readAll(contents); | 219 | const amt = try reader.readAll(contents); |
| 219 | if (amt != object_size) { | 220 | if (amt != object_size) { |
| 220 | return error.Io; | 221 | return error.InputOutput; |
| 221 | } | 222 | } |
| 222 | | 223 | |
| 223 | var object = Object{ | 224 | var object = Object{ |