commit cf5e64eb45136ad11026ee790dd834312559d581 (tree)
parent 6e8aca3fdd36f08c4da22480375f5a37544a3ae5
Author: Motiejus Jakštys <motiejus.jakstys@chronosphere.io>
Date: Fri, 13 Feb 2026 07:29:54 +0000
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>
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/astgen.c b/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