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).

Regards,
Sergei
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to