[fpc-pascal] reference-counted function results not initialized to nil

Maciej Izak hnb.code at gmail.com
Sat Jun 25 09:23:31 CEST 2016


2016-06-25 5:19 GMT+02:00 Michalis Kamburelis <michalis.kambi at gmail.com>:

> They were never guaranteed to be initialized to nil.
>

Result has special logic for string, dynamic array, method pointer and
variant (well documented ;) ):

"For a string, dynamic array, method pointer, or variant result, the
effects are the same as if the function result were declared as an
additional var parameter following the declared parameters. In other words,
the caller passes an additional 32-bit pointer that points to a variable in
which to return the function result."

http://docwiki.embarcadero.com/RADStudio/Berlin/en/Program_Control#Handling_Function_Results

-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160625/a6ad70a6/attachment.html>


More information about the fpc-pascal mailing list