[fpc-pascal] Compiler bug with managed type not being initialized correctly

Paul Ishenin paul.ishenin at gmail.com
Sat May 18 16:13:41 CEST 2013


18.05.13, 9:41, Anthony Walter wrote:

> I just filed a bug having to do with a managed type (I am using an
> interface in my code) not being properly initialized when stored in a
> record's private section:
>
> http://bugs.freepascal.org/view.php?id=24447

I tested the given example and I can't see any error. Although I tested 
on win32 platform.

Please compile RTL with debug information and try to debug 
fpc_Initialize routine from rtti.inc.

During the testing of your example I see that it executes on each enter 
to Test1 and Test2:

1. It steps into tkRecord case of fpc_initialize and then enters to 
recordrtti
2. In recordrtti Count = 1 (1 managed field), so it executes the 
for-loop body 1 time.
3. In for loop it enters rttiproc = fpc_initialize with Offset = 0 and 
TypeInfo of tkInterface.
4. In fpc_initialize it assignes nil to Data (interface field).

If in your case you see something else please reply to this mail or to 
the bug tracker.

Best regards,
Paul Ishenin



More information about the fpc-pascal mailing list