From 8159ff8b811a1621674b0f00a01b5a92698af8f9 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Thu, 13 Feb 2025 17:09:21 -0500 Subject: x86_64: implement error set and enum safety This is all of the expected 0.14.0 progress on #21530, which can now be postponed once this commit is merged. This required rewriting the (un)wrap operations since the original implementations were extremely buggy. Also adds an easy way to retrigger Sema OPV bugs so that I don't have to keep updating #22419 all the time. --- src/codegen.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/codegen.zig') diff --git a/src/codegen.zig b/src/codegen.zig index 6d054f6b01..7726af8387 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -83,8 +83,10 @@ pub fn generateLazyFunction( debug_output: link.File.DebugInfoOutput, ) CodeGenError!void { const zcu = pt.zcu; - const file = Type.fromInterned(lazy_sym.ty).typeDeclInstAllowGeneratedTag(zcu).?.resolveFile(&zcu.intern_pool); - const target = zcu.fileByIndex(file).mod.resolved_target.result; + const target = if (Type.fromInterned(lazy_sym.ty).typeDeclInstAllowGeneratedTag(zcu)) |inst_index| + zcu.fileByIndex(inst_index.resolveFile(&zcu.intern_pool)).mod.resolved_target.result + else + zcu.getTarget(); switch (target_util.zigBackend(target, false)) { else => unreachable, inline .stage2_x86_64, .stage2_riscv64 => |backend| { -- cgit v1.2.3