2
0
Эх сурвалжийг харах

* always write a class' reference to the attribute table, even if the unit does not have attributes

git-svn-id: trunk@42368 -
svenbarth 6 жил өмнө
parent
commit
ee940c8270

+ 1 - 2
compiler/ncgrtti.pas

@@ -1569,8 +1569,7 @@ implementation
             write_unit_info_reference(tcb);
 
             { TAttributeData }
-            if rmo_hasattributes in current_module.rtti_options then
-                write_attribute_data(tcb, def.rtti_attribute_list);
+            write_attribute_data(tcb, def.rtti_attribute_list);
 
             { write published properties for this object }
             published_properties_write_rtti_data(tcb,propnamelist,def.symtable);

+ 2 - 7
rtl/objpas/typinfo.pp

@@ -1029,10 +1029,7 @@ begin
   else
     begin
       TD := GetTypeData(TypeInfo);
-      if (rmoHasAttributes in td^.UnitInfo^.UnitOptions) then
-        Result:=PAttributeData(PPointer(aligntoptr(pointer(@TD^.UnitInfo)+sizeof(TD^.UnitInfo)))^)
-      else
-        result := nil;
+      Result:=PAttributeData(PPointer(aligntoptr(pointer(@TD^.UnitInfo)+sizeof(TD^.UnitInfo)))^)
     end;
 end;
 
@@ -1040,9 +1037,7 @@ function GetPropData(TypeInfo : PTypeInfo; TypeData: PTypeData) : PPropData;
 var
   p: PtrUInt;
 begin
-  p := PtrUInt(@TypeData^.UnitInfo) + SizeOf(TypeData^.UnitInfo);
-  if rmoHasAttributes in TypeData^.UnitInfo^.UnitOptions then
-    p := p + SizeOf(PAttributeData);
+  p := PtrUInt(@TypeData^.UnitInfo) + SizeOf(TypeData^.UnitInfo) + SizeOf(PAttributeData);
   Result := PPropData(aligntoptr(Pointer(p)));
 end;