[fpc-devel] TypeInfo RTTI / possible inconsistency

Martin Frb lazarus at mfriebe.de
Wed May 19 22:42:17 CEST 2021


On 19/05/2021 22:10, Sven Barth wrote:
> Am 18.05.2021 um 15:24 schrieb Martin Frb via fpc-devel:
>> I was looking at TypeInfo (based on 3.2.2rc)
>> .....
>>
>> fpc_3.2.2\source\tests\webtbs\tw12038.pp
>>    line 194    procedure DisplayDetails(Informations : TPropInfo; 
>> const expectedresult: ansistring);
>> appears to access the data (except for the ParamTypeRefs array)
>> The testcase does not seem to make any adjustments for alignment.
>
> It does at line 285.
Ok, now I looked at trunk (should have done before).
In 3.2.2rc the align is not present.


>
>>
>> It makes alignments in 3 different places
>>    ptr := AlignTParamFlags(ptr);                // foreach Flags : 
>> TParamFlags;   in the ParamList
>>    ptr := AlignToPtr(PByte(ptr) + ptr^ + SizeOf(Byte));    // 
>> ResultTypeRef
>>    paramtypes := PPPTypeInfo(AlignTypeData(ptr));       // ParamTypeRefs
>>
>> Which is correct?
>> Or do they access different structures?
>
> They are for different parts of the structure, 
Misunderstanding. Not "which of the 3", but "testcase or unit" => 
Solved, the latter (in trunk: both)

Anyway thanks for the feedback.



More information about the fpc-devel mailing list