Commit e17c4a497f

Jakub Konka <kubkon@jakubkonka.com>
2021-11-21 23:30:17
zld: parse []TbdV3 before TbdV3
1 parent 40e49fe
Changed files (1)
src
src/link/tapi.zig
@@ -127,6 +127,16 @@ pub const LibStub = struct {
                 break :blk out;
             }
 
+            err: {
+                log.debug("trying to parse as []TbdV3", .{});
+                const inner = lib_stub.yaml.parse([]TbdV3) catch break :err;
+                var out = try lib_stub.yaml.arena.allocator.alloc(Tbd, inner.len);
+                for (inner) |doc, i| {
+                    out[i] = .{ .v3 = doc };
+                }
+                break :blk out;
+            }
+
             err: {
                 log.debug("trying to parse as TbdV3", .{});
                 const inner = lib_stub.yaml.parse(TbdV3) catch break :err;