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 <noreply@anthropic.com>
This commit is contained in:
3
astgen.c
3
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);
|
||||
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user