[fpc-devel] TypeInfo RTTI / possible inconsistency
Sven Barth
pascaldragon at googlemail.com
Wed May 19 23:31:41 CEST 2021
Am 19.05.2021 um 22:42 schrieb Martin Frb:
> 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.
That is because the alignment requirements changed in trunks with the
addition of the attributes (though I'm not entirely happy with that yet).
>
>>
>>>
>>> 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)
The test should be correct in 3.2.0 as well.
Regards,
Sven
More information about the fpc-devel
mailing list