| ... | @@ -745,7 +745,15 @@ pub const Value = struct { | ... | @@ -745,7 +745,15 @@ pub const Value = struct { |
| 745 | .Extern => for (ty.structFields(mod).values(), 0..) |field, i| { | 745 | .Extern => for (ty.structFields(mod).values(), 0..) |field, i| { |
| 746 | const off = @intCast(usize, ty.structFieldOffset(i, mod)); | 746 | const off = @intCast(usize, ty.structFieldOffset(i, mod)); |
| 747 | const field_val = switch (val.ip_index) { | 747 | const field_val = switch (val.ip_index) { |
| 748 | .none => val.castTag(.aggregate).?.data[i], | 748 | .none => switch (val.tag()) { |
| | 749 | .bytes => { |
| | 750 | buffer[off] = val.castTag(.bytes).?.data[i]; |
| | 751 | continue; |
| | 752 | }, |
| | 753 | .aggregate => val.castTag(.aggregate).?.data[i], |
| | 754 | .repeated => val.castTag(.repeated).?.data, |
| | 755 | else => unreachable, |
| | 756 | }, |
| 749 | else => switch (mod.intern_pool.indexToKey(val.toIntern()).aggregate.storage) { | 757 | else => switch (mod.intern_pool.indexToKey(val.toIntern()).aggregate.storage) { |
| 750 | .bytes => |bytes| { | 758 | .bytes => |bytes| { |
| 751 | buffer[off] = bytes[i]; | 759 | buffer[off] = bytes[i]; |