Skip to content

Commit 7349873

Browse files
committed
x86_64: fix error_set_has_value of inferred error sets
1 parent 06eebaf commit 7349873

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/arch/x86_64/CodeGen.zig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116306,10 +116306,17 @@ 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 ip = &pt.zcu.intern_pool;
116309116310
const ty = if (lazy_symbol_spec.ref == .none) spec.type else lazy_symbol_spec.ref.typeOf(s);
116310116311
const lazy_symbol: link.File.LazySymbol = .{
116311116312
.kind = lazy_symbol_spec.kind,
116312-
.ty = ty.toIntern(),
116313+
.ty = switch (ip.indexToKey(ty.toIntern())) {
116314+
.inferred_error_set_type => |func_index| switch (ip.funcIesResolvedUnordered(func_index)) {
116315+
.none => unreachable, // unresolved inferred error set
116316+
else => |ty_index| ty_index,
116317+
},
116318+
else => ty.toIntern(),
116319+
},
116313116320
};
116314116321
return .{ try cg.tempInit(.usize, .{ .lea_symbol = .{
116315116322
.sym_index = if (cg.bin_file.cast(.elf)) |elf_file|

0 commit comments

Comments
 (0)