Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-05

Compiler bug with managed type not being initialized correctly

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter

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 marked the issue as major since I thought this kind of issue (managed types slipping through initialization should never happen. If anyone want more clarity on this issue let me know. As an added note, if this situation causes an interface to not be initialized,it probably also has problems with finalization that need being looked at as well.

Managed types described (as best as I could find):

http://bit.ly/12BtOnr

Reply by email

Paul Ishenin
to Anthony Walter
Anthony Walter wrote 5 lines
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

Reply by email