mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 20:13:21 +00:00
fix incorrect zir offset loading in sema
This commit is contained in:
parent
d819663543
commit
8c23b81e86
@ -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]);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user