Am 23.06.2011 22:31, schrieb Martin: > > This is about finding screwups of the refcount. The data modification > detection of strings is a side effect only. >
Why is a "screwup" of the ref. count a problem? It is only a problem if it gets 0 and the string is disposed? > > > > Anyway, I repeat. I do not try to detect, if the string content was > changed => that is a side effect > > I try to catch issues with the refcount. > > They do not happen, if the string is part of a const param record > Why not? This ... {$h+} type tr = record s : string; end; var r : tr; procedure proc; begin r.s:='1234'; end; procedure Foo(const r : tr); begin proc; // r.s is invalid now ... end; begin setlength(r.s,10); Foo(r); end. ... hurts as well because r is passed by value because it is small. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel