[fpc-devel] 019605: Safety check for "const s: string" (similar to Range or Overflow checks)

Martin fpc at mfriebe.de
Thu Jun 23 23:03:37 CEST 2011


And what exactly does checkpointer check?

That s is not nil ? => s will never be nil. If something goes wrong, s 
points to memory of which nothing is known (could be unallocated, could 
be allocated by something else)

On 23/06/2011 21:37, Florian Klämpfl wrote:
> Am 23.06.2011 22:36, schrieb Martin:
>>> procedure Foo(const s: string);
>>>     begin
>>>       proc;
>> I assume the below is supposed to be the hidden / automatic check?
> Yes.
>
>> (since the above was the unwarranted change to s)
>>
>> But what does it test (besides from being an assignment?
> This is only to demonstrate that checkpointer detects the error.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel




More information about the fpc-devel mailing list