On 22/07/2010 09:57, Sergei Gorelkin wrote:
Martin пишет:
Anyone any idea, if there s any code that could cause such an
"optimization" ?
This is by design. 'const' modifier on ansistring and other 'managed'
type arguments instucts the compiler to omit refcount changes,
yielding a faster code. At the same time it prohibits direct
modification to the argument, but nothing can be done if you modify
another location that aliases the argument.
If you need proper refcounting, you should pass the argument by value
(i.e. without 'const' modifier).
So, no need to report as bug then?
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel