From 2717f8ca915d6fecbeaf0b9f00e2ae1309f84b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 13 Feb 2026 05:45:50 +0000 Subject: [PATCH] astgen: add missing emitDbgNode for if condition Port the emitDbgNode(parent_gz, cond_expr) call from upstream AstGen.zig:6335 into ifExpr. This emits a DBG_STMT instruction before evaluating the if condition, matching the reference output. Enable astgen_test.zig corpus test (still has extra_len and string_bytes mismatches to fix). Co-Authored-By: Claude Opus 4.6 --- astgen.c | 3 +++ astgen_test.zig | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/astgen.c b/astgen.c index 279cb8d2eb..5a42a4e131 100644 --- a/astgen.c +++ b/astgen.c @@ -4038,6 +4038,9 @@ static uint32_t ifExpr(GenZir* gz, Scope* scope, ResultLoc rl, uint32_t node) { } } + // Emit DBG_STMT for condition (AstGen.zig:6335). + emitDbgNode(gz, cond_node); + // Create block_scope (AstGen.zig:6326-6328). GenZir block_scope = makeSubBlock(gz, scope); diff --git a/astgen_test.zig b/astgen_test.zig index d567816ac3..6949fba732 100644 --- a/astgen_test.zig +++ b/astgen_test.zig @@ -1000,7 +1000,6 @@ test "astgen: corpus tokenizer_test.zig" { } test "astgen: corpus astgen_test.zig" { - if (true) return error.SkipZigTest; // TODO: 1 missing dbg_stmt, extra_len mismatch const gpa = std.testing.allocator; try corpusCheck(gpa, "astgen_test.zig", @embedFile("astgen_test.zig")); }