diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-02-13 17:09:21 -0500 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-02-15 03:45:21 -0500 |
| commit | 8159ff8b811a1621674b0f00a01b5a92698af8f9 (patch) | |
| tree | 273c5d568004ec6d40e0d35919ddf81533e54dcd /src/codegen.zig | |
| parent | 5ab5113077bf82237978168b32e2b549a4a71feb (diff) | |
| download | zig-8159ff8b811a1621674b0f00a01b5a92698af8f9.tar.gz zig-8159ff8b811a1621674b0f00a01b5a92698af8f9.zip | |
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.
Diffstat (limited to 'src/codegen.zig')
| -rw-r--r-- | src/codegen.zig | 6 |
1 files changed, 4 insertions, 2 deletions
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| { |
