mirror of
https://github.com/ziglang/zig.git
synced 2025-12-10 08:13:07 +00:00
Zir: fix wrong union field access for declaration
This commit is contained in:
parent
60318a1e39
commit
ba623b160e
@ -1,5 +1,7 @@
|
|||||||
//! Zig Intermediate Representation. Astgen.zig converts AST nodes to these
|
//! Zig Intermediate Representation.
|
||||||
//! untyped IR instructions. Next, Sema.zig processes these into AIR.
|
//!
|
||||||
|
//! Astgen.zig converts AST nodes to these untyped IR instructions. Next,
|
||||||
|
//! Sema.zig processes these into AIR.
|
||||||
//! The minimum amount of information needed to represent a list of ZIR instructions.
|
//! The minimum amount of information needed to represent a list of ZIR instructions.
|
||||||
//! Once this structure is completed, it can be used to generate AIR, followed by
|
//! Once this structure is completed, it can be used to generate AIR, followed by
|
||||||
//! machine code, without any memory access into the AST tree token list, node list,
|
//! machine code, without any memory access into the AST tree token list, node list,
|
||||||
@ -4024,8 +4026,8 @@ pub fn getAssociatedSrcHash(zir: Zir, inst: Zir.Inst.Index) ?std.zig.SrcHash {
|
|||||||
const data = zir.instructions.items(.data);
|
const data = zir.instructions.items(.data);
|
||||||
switch (tag[@intFromEnum(inst)]) {
|
switch (tag[@intFromEnum(inst)]) {
|
||||||
.declaration => {
|
.declaration => {
|
||||||
const pl_node = data[@intFromEnum(inst)].pl_node;
|
const declaration = data[@intFromEnum(inst)].declaration;
|
||||||
const extra = zir.extraData(Inst.Declaration, pl_node.payload_index);
|
const extra = zir.extraData(Inst.Declaration, declaration.payload_index);
|
||||||
return @bitCast([4]u32{
|
return @bitCast([4]u32{
|
||||||
extra.data.src_hash_0,
|
extra.data.src_hash_0,
|
||||||
extra.data.src_hash_1,
|
extra.data.src_hash_1,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user