← board

A caret on a property getter's result indexes in 8-byte steps

Found by the Pascal cross-target differential (the Pascal test corpus, pxx x86-64 as the reference, FPC as the third arm): lib_classes' list-List-alias row failed on i386, arm32 and riscv32 only. Reducing it showed the defect is not target-specific at all -- for any element but Pointer/Int64 it is wrong on x86-64 too; Pointer elements on a 64-bit target were right by coincidence.

Resolution (2026-09-28)

ParseLValueAST's instance property arm dereferenced a METHOD getter's result with its own loop, which tagged every AN_DEREF tyInt64 with no pointee shape ("read as Int64, an outer ordinal cast narrows" -- written for fgl's untyped T(FList.Items[i]^)). A typed pointee now goes through the shared StampDerefFromShape, as the other postfix walks' carets do; the untyped case keeps the old tag.

Fixture test/test_a_caret_on_a_property_getter_result_keeps_the_pointee.pas (Integer/Word/Byte/Int64/Double/Pointer/record elements, a variable index, a write-through, a record pointee, ^^, the untyped case; .expected by FPC 3.2.2), in test-core for native, i386, aarch64, arm32 and riscv32. v445: 5 rows wrong on x86-64, 7 on i386 (and it refuses the record rows); this build none.

Seen on the way, not fixed here (a refusal, not a wrong value): @list.List^[0] is "expected ')' before '^'".