TList.Count is writable
- Type: feature (compat — FPC RTL property has a setter, ours did not) —
Track B (
lib/rtl/classes.pas), landed by Track P, which hit it.
for i := OldListCount to VarList.Count - 1 do
TPasElement(VarList[i]).Release;
VarList.Count := OldListCount; { pxx: property is read-only }
fcl-passrc pparser.pp:4768, in ParseVarList's error path. It is the ordinary
way to unwind a list back to a mark.
Why the notify row is the whole test
A SetCount written as a bare SetLength produces the right Count, the right
surviving elements and the right nil slots. Every value assertion about the
container passes. What it does is drop elements without telling an owning
descendant, which leaks them — and no output assertion about the list can see
that. Ablated and measured: only notify fired moves, 3 -> 0.
This is the same class as the open-array leak that assert_no_leak.sh exists
for; the cheap instrument here is that FPC's own Notify callback is
observable, so the count of lnDeleted calls is directly comparable against the
fpc oracle where a leak is not.
Log
- 2026-09-06 — fixed, commit 3034ac606.