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

Sven Barth pascaldragon at googlemail.com
Sat Jun 25 10:04:41 CEST 2016


Am 25.06.2016 09:23 schrieb "Maciej Izak" <hnb.code at gmail.com>:
>
> 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

And them being var-parameters basically states that they retain whatever
value they had.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160625/5cb8fef5/attachment.html>


More information about the fpc-pascal mailing list