diff --git a/astgen.c b/astgen.c index 41a4d8e607..bbbca4f87e 100644 --- a/astgen.c +++ b/astgen.c @@ -4374,7 +4374,7 @@ static uint32_t exprRl(GenZir* gz, Scope* scope, ResultLoc rl, uint32_t node) { case AST_NODE_BLOCK_TWO_SEMICOLON: case AST_NODE_BLOCK: case AST_NODE_BLOCK_SEMICOLON: - return blockExprExpr(gz, scope, rl, node); + return rvalue(gz, rl, blockExprExpr(gz, scope, rl, node), node); // Anonymous array init (AstGen.zig:1119-1127). case AST_NODE_ARRAY_INIT_DOT_TWO: case AST_NODE_ARRAY_INIT_DOT_TWO_COMMA: @@ -5611,6 +5611,8 @@ static uint32_t whileExpr( // Evaluate condition in cond_scope (AstGen.zig:6571-6607). GenZir cond_scope = makeSubBlock(&loop_scope, &loop_scope.base); + // Emit debug node for the condition expression (AstGen.zig:6579). + emitDbgNode(&cond_scope, cond_node); uint32_t cond = expr(&cond_scope, &cond_scope.base, cond_node); // Create condbr + cond_block (AstGen.zig:6609-6615). diff --git a/astgen_test.zig b/astgen_test.zig index 8c40cc5f6f..1cd940b43f 100644 --- a/astgen_test.zig +++ b/astgen_test.zig @@ -798,8 +798,8 @@ test "astgen: corpus tokenizer_test.zig" { } test "astgen: corpus parser_test.zig" { - // TODO: 1 inst diff — 1 STORE_NODE inside ptr-based struct init with - // block field init expression. + // TODO: int_type signedness data mismatch at inst[6899] — all tags and + // inst_len match, but one int_type has ref=signed got=unsigned. if (true) return error.SkipZigTest; const gpa = std.testing.allocator; try corpusCheck(gpa, @embedFile("parser_test.zig"));