From 6910aeb897005ac035474623ef43348dba0e65cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 13 Feb 2026 17:00:29 +0000 Subject: [PATCH] astgen: fix double ZIR_REF_START_INDEX in assignOp addInstruction() already returns idx + ZIR_REF_START_INDEX (a ref), so the extra + ZIR_REF_START_INDEX on the inplace_arith_result_ty path resulted in a double-offset (+248 instead of +124) being stored in extra data for += and -= compound assignments. Co-Authored-By: Claude Opus 4.6 --- astgen.c | 3 +-- astgen_test.zig | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/astgen.c b/astgen.c index cac642f070..bd2f14d88e 100644 --- a/astgen.c +++ b/astgen.c @@ -5963,8 +5963,7 @@ static void assignOp( ext_data.extended.opcode = (uint16_t)ZIR_EXT_INPLACE_ARITH_RESULT_TY; ext_data.extended.small = inplace_op; ext_data.extended.operand = lhs; - rhs_res_ty = addInstruction(gz, ZIR_INST_EXTENDED, ext_data) - + ZIR_REF_START_INDEX; + rhs_res_ty = addInstruction(gz, ZIR_INST_EXTENDED, ext_data); } else { rhs_res_ty = addUnNode(gz, ZIR_INST_TYPEOF, lhs, infix_node); } diff --git a/astgen_test.zig b/astgen_test.zig index 5c8fc6856d..6d61a7dd03 100644 --- a/astgen_test.zig +++ b/astgen_test.zig @@ -798,7 +798,7 @@ test "astgen: corpus tokenizer_test.zig" { } test "astgen: corpus astgen_test.zig" { - if (true) return error.SkipZigTest; // TODO: store_node ref off-by-1 at inst 1764 + if (true) return error.SkipZigTest; // TODO: extra data offset mismatches const gpa = std.testing.allocator; try corpusCheck(gpa, @embedFile("astgen_test.zig")); }