Skip to content

Commit 19018be

Browse files
committed
x86_64: fix error_set_has_value of inferred error sets
1 parent 4e090e5 commit 19018be

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/arch/x86_64/CodeGen.zig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116306,10 +116306,18 @@ const Select = struct {
116306116306
},
116307116307
.frame => |frame_index| .{ try cg.tempInit(spec.type, .{ .load_frame = .{ .index = frame_index } }), true },
116308116308
.lazy_symbol => |lazy_symbol_spec| {
116309+
const zcu = pt.zcu;
116310+
const ip = &zcu.intern_pool;
116309116311
const ty = if (lazy_symbol_spec.ref == .none) spec.type else lazy_symbol_spec.ref.typeOf(s);
116310116312
const lazy_symbol: link.File.LazySymbol = .{
116311116313
.kind = lazy_symbol_spec.kind,
116312-
.ty = ty.toIntern(),
116314+
.ty = switch (ip.indexToKey(ty.toIntern())) {
116315+
.inferred_error_set_type => |func_index| switch (ip.funcIesResolvedUnordered(func_index)) {
116316+
.none => unreachable, // unresolved inferred error set
116317+
else => |ty_index| ty_index,
116318+
},
116319+
else => ty.toIntern(),
116320+
},
116313116321
};
116314116322
return .{ try cg.tempInit(.usize, .{ .lea_symbol = .{
116315116323
.sym_index = if (cg.bin_file.cast(.elf)) |elf_file|

0 commit comments

Comments
 (0)