diff --git a/.gitattributes b/.gitattributes index d063f9dbf1..50bd0806d0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11830,6 +11830,7 @@ tests/tbs/tb0653.pp svneol=native#text/plain tests/tbs/tb0654.pp svneol=native#text/plain tests/tbs/tb0655.pp svneol=native#text/pascal tests/tbs/tb0656.pp svneol=native#text/pascal +tests/tbs/tb0657.pp svneol=native#text/pascal tests/tbs/tb205.pp svneol=native#text/plain tests/tbs/tb610.pp svneol=native#text/pascal tests/tbs/tb613.pp svneol=native#text/plain diff --git a/rtl/objpas/fgl.pp b/rtl/objpas/fgl.pp index fa70673557..91da1c362b 100644 --- a/rtl/objpas/fgl.pp +++ b/rtl/objpas/fgl.pp @@ -900,7 +900,7 @@ end; function TFPGList.GetList: PTypeList; begin - Result := PTypeList(FList); + Result := PTypeList(@FList); end; function TFPGList.ItemPtrCompare(Item1, Item2: Pointer): Integer; @@ -1035,7 +1035,7 @@ end; function TFPGObjectList.GetList: PTypeList; begin - Result := PTypeList(FList); + Result := PTypeList(@FList); end; function TFPGObjectList.ItemPtrCompare(Item1, Item2: Pointer): Integer; @@ -1165,7 +1165,7 @@ end; function TFPGInterfacedObjectList.GetList: PTypeList; begin - Result := PTypeList(FList); + Result := PTypeList(@FList); end; function TFPGInterfacedObjectList.ItemPtrCompare(Item1, Item2: Pointer): Integer; diff --git a/tests/tbs/tb0657.pp b/tests/tbs/tb0657.pp new file mode 100644 index 0000000000..e890ed9d0c --- /dev/null +++ b/tests/tbs/tb0657.pp @@ -0,0 +1,29 @@ +program tb0657; + +{$mode objfpc} + +uses + fgl; + +type + TIntList = specialize TFPGList<LongInt>; + +const + c = 3; + +var + l: TIntList; + i: LongInt; +begin + l := TIntList.Create; + try + for i := 0 to c do + l.Add(i); + + for i := 0 to l.Count - 1 do + if l.List^[i] <> i then + Halt(i + 1); + finally + l.Free; + end; +end.