mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 19:50:26 +02:00
* correct return a pointer to the list so that List^[x] works as it did before 3.2
+ added test git-svn-id: trunk@41938 -
This commit is contained in:
parent
639adc314f
commit
b7a716cd81
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11830,6 +11830,7 @@ tests/tbs/tb0653.pp svneol=native#text/plain
|
|||||||
tests/tbs/tb0654.pp svneol=native#text/plain
|
tests/tbs/tb0654.pp svneol=native#text/plain
|
||||||
tests/tbs/tb0655.pp svneol=native#text/pascal
|
tests/tbs/tb0655.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0656.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/tb205.pp svneol=native#text/plain
|
||||||
tests/tbs/tb610.pp svneol=native#text/pascal
|
tests/tbs/tb610.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb613.pp svneol=native#text/plain
|
tests/tbs/tb613.pp svneol=native#text/plain
|
||||||
|
@ -900,7 +900,7 @@ end;
|
|||||||
|
|
||||||
function TFPGList.GetList: PTypeList;
|
function TFPGList.GetList: PTypeList;
|
||||||
begin
|
begin
|
||||||
Result := PTypeList(FList);
|
Result := PTypeList(@FList);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFPGList.ItemPtrCompare(Item1, Item2: Pointer): Integer;
|
function TFPGList.ItemPtrCompare(Item1, Item2: Pointer): Integer;
|
||||||
@ -1035,7 +1035,7 @@ end;
|
|||||||
|
|
||||||
function TFPGObjectList.GetList: PTypeList;
|
function TFPGObjectList.GetList: PTypeList;
|
||||||
begin
|
begin
|
||||||
Result := PTypeList(FList);
|
Result := PTypeList(@FList);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFPGObjectList.ItemPtrCompare(Item1, Item2: Pointer): Integer;
|
function TFPGObjectList.ItemPtrCompare(Item1, Item2: Pointer): Integer;
|
||||||
@ -1165,7 +1165,7 @@ end;
|
|||||||
|
|
||||||
function TFPGInterfacedObjectList.GetList: PTypeList;
|
function TFPGInterfacedObjectList.GetList: PTypeList;
|
||||||
begin
|
begin
|
||||||
Result := PTypeList(FList);
|
Result := PTypeList(@FList);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFPGInterfacedObjectList.ItemPtrCompare(Item1, Item2: Pointer): Integer;
|
function TFPGInterfacedObjectList.ItemPtrCompare(Item1, Item2: Pointer): Integer;
|
||||||
|
29
tests/tbs/tb0657.pp
Normal file
29
tests/tbs/tb0657.pp
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user