diff options
| author | Loris Cro <kappaloris@gmail.com> | 2022-01-21 22:46:12 +0100 |
|---|---|---|
| committer | Loris Cro <kappaloris@gmail.com> | 2022-01-21 22:46:12 +0100 |
| commit | 8c23b81e8640df490e2168b9a623bbb57a7d353e (patch) | |
| tree | b6f4e9f42b971b0fd356239e52f9ed6748ee26f9 /src/Module.zig | |
| parent | d819663543bd2f19bcabb86978adf06931a2dd8b (diff) | |
| download | zig-8c23b81e8640df490e2168b9a623bbb57a7d353e.tar.gz zig-8c23b81e8640df490e2168b9a623bbb57a7d353e.zip | |
fix incorrect zir offset loading in sema
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Module.zig b/src/Module.zig index ecfc15a319..3892b35aea 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -558,14 +558,14 @@ pub const Decl = struct { if (!decl.has_align) return .none; assert(decl.zir_decl_index != 0); const zir = decl.getFileScope().zir; - return @intToEnum(Zir.Inst.Ref, zir.extra[decl.zir_decl_index + 7]); + return @intToEnum(Zir.Inst.Ref, zir.extra[decl.zir_decl_index + 8]); } pub fn zirLinksectionRef(decl: Decl) Zir.Inst.Ref { if (!decl.has_linksection_or_addrspace) return .none; assert(decl.zir_decl_index != 0); const zir = decl.getFileScope().zir; - const extra_index = decl.zir_decl_index + 7 + @boolToInt(decl.has_align); + const extra_index = decl.zir_decl_index + 8 + @boolToInt(decl.has_align); return @intToEnum(Zir.Inst.Ref, zir.extra[extra_index]); } @@ -573,7 +573,7 @@ pub const Decl = struct { if (!decl.has_linksection_or_addrspace) return .none; assert(decl.zir_decl_index != 0); const zir = decl.getFileScope().zir; - const extra_index = decl.zir_decl_index + 7 + @boolToInt(decl.has_align) + 1; + const extra_index = decl.zir_decl_index + 8 + @boolToInt(decl.has_align) + 1; return @intToEnum(Zir.Inst.Ref, zir.extra[extra_index]); } |
