Re: Downsizing the dynamic Array
"Tom de Neef" <email@example.com> wrote in message
> [...] FillChar starts with:
> P := PChar(@Dest);
> (or an assembler equivalent). And that destination is (PChar(p) +
> elSize * oldLength)^ which is outside the scope of the array if it
> is newly created. Whether or not the array is recreated in a new
> memory location or kept its old location depends on the refcount.
> But I would say that there are conditions under which this first
> statement in FillChar will access an invalid address. Whether that
> will cause an AV I can not judge.
Merely computing an address you don't own won't generate any faults.
It's dereferencing it, reading or writing the memory at that address,