Browse Source

Avoid access to a non existing field during cycling (just in case).

rtl/inc/rtti.inc:
  * RTTIRefCountOffset: return 0 for 2.6.x

git-svn-id: branches/svenbarth/arc@28910 -
svenbarth 10 years ago
parent
commit
745c981b5d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      rtl/inc/rtti.inc

+ 6 - 0
rtl/inc/rtti.inc

@@ -99,13 +99,19 @@ begin
 end;
 
 function RTTIRefCountOffset(TypeInfo: Pointer): SizeInt;
+{$ifndef VER2_6}
 var
   info: PRecordInfo;
   refcount: PSizeInt;
+{$endif}
 begin
+{$ifdef VER2_6}
+  Result:=0;
+{$else}
   info:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
   refcount:=PSizeInt(Pointer(info)+SizeOf(TRecordInfo)+info^.Count*SizeOf(TRecordElement));
   Result:=refcount^;
+{$endif}
 end;
 
 { if you modify this procedure, fpc_copy must be probably modified as well }