astgen: fix fnDecl break_inline to use correct node offset
Use nodeIndexToRelative(decl_node) = node - proto_node for the break_inline returning func to declaration, matching upstream AstGen.zig:4495. Previously used AST_NODE_OFFSET_NONE which produced incorrect extra data values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
7
astgen.c
7
astgen.c
@@ -7453,9 +7453,10 @@ static void fnDecl(AstGenCtx* ag, GenZir* gz, uint32_t* wip_decl_insts,
|
||||
}
|
||||
free(ret_body);
|
||||
|
||||
// break_inline returning func to declaration
|
||||
// (AstGen.zig:4495).
|
||||
makeBreakInline(&decl_gz, decl_inst, func_ref, AST_NODE_OFFSET_NONE);
|
||||
// break_inline returning func to declaration (AstGen.zig:4495).
|
||||
// nodeIndexToRelative(decl_node) = node - decl_gz.decl_node_index.
|
||||
makeBreakInline(
|
||||
&decl_gz, decl_inst, func_ref, (int32_t)node - (int32_t)proto_node);
|
||||
|
||||
// setDeclaration (AstGen.zig:4208-4225).
|
||||
DeclFlagsId decl_id
|
||||
|
||||
Reference in New Issue
Block a user