diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-05-29 00:10:36 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:47:56 -0700 |
| commit | 32692569656d9a178abb24f8fb7893395700cb62 (patch) | |
| tree | c2f10d2ed2d1d5e0e6c1cd2d532c6d76d401a466 /src/InternPool.zig | |
| parent | 3064d2aa7b9a8ea836cb70884b0640fe902ecc29 (diff) | |
| download | zig-32692569656d9a178abb24f8fb7893395700cb62.tar.gz zig-32692569656d9a178abb24f8fb7893395700cb62.zip | |
behavior: fix more compiler crashes
Diffstat (limited to 'src/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index 55ab58c391..90e0e2bd35 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -1416,7 +1416,12 @@ pub const Index = enum(u32) { only_possible_value: DataIsIndex, union_value: struct { data: *Key.Union }, bytes: struct { data: *Bytes }, - aggregate: struct { data: *Aggregate }, + aggregate: struct { + const @"data.ty.data.len orelse data.ty.data.fields_len" = opaque {}; + data: *Aggregate, + @"trailing.element_values.len": *@"data.ty.data.len orelse data.ty.data.fields_len", + trailing: struct { element_values: []Index }, + }, repeated: struct { data: *Repeated }, memoized_decl: struct { data: *Key.MemoizedDecl }, @@ -4437,7 +4442,7 @@ pub fn getCoerced(ip: *InternPool, gpa: Allocator, val: Index, new_ty: Index) Al .Slice => try ip.get(gpa, .{ .undef = .usize_type }), }, } }), - else => try ip.getCoerced(gpa, opt.val, new_ty), + else => |payload| try ip.getCoerced(gpa, payload, new_ty), }, .err => |err| if (ip.isErrorSetType(new_ty)) return ip.get(gpa, .{ .err = .{ @@ -4622,7 +4627,7 @@ pub fn isErrorUnionType(ip: InternPool, ty: Index) bool { pub fn isAggregateType(ip: InternPool, ty: Index) bool { return switch (ip.indexToKey(ty)) { - .array_wype, .vector_type, .anon_struct_type, .struct_type => true, + .array_type, .vector_type, .anon_struct_type, .struct_type => true, else => false, }; } |
