May I propose a more generic solution: - with some switch (-gc?) a call to checkpointer is inkoved at the end of a procedure for const ref. counted types. Together with -gh this catches the common case:
{$h+} var s : string; procedure proc; begin s:='1234'; end; procedure Foo(const s: string); begin proc; pbyte(s)^:=1; // force checkpointer call on s for testing purposes end; begin setlength(s,10); Foo(s); end. If this is not enough - we can introduce a compiler switch (or reuse an existing) which builds a checksum on the relevant data of a const parameter on function entry. At function exit, this checksum is checked. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel