mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 05:10:52 +02:00
Merge branch 'objpas.inc_variable_i' into 'main'
Fix variable i range of values in a couple of routines. See merge request freepascal.org/fpc/source!1122
This commit is contained in:
commit
75f7922221
@ -408,7 +408,7 @@ end;
|
||||
|
||||
var
|
||||
ovmt: PVmt;
|
||||
i: longint;
|
||||
i: sizeuint;
|
||||
intftable: pinterfacetable;
|
||||
Res: pinterfaceentry;
|
||||
begin
|
||||
@ -434,10 +434,11 @@ end;
|
||||
var
|
||||
vmt : PVmt;
|
||||
inittable : pointer;
|
||||
Res : ^TRTTIRecordOpOffsetEntry;
|
||||
{$ifdef FPC_HAS_FEATURE_RTTI}
|
||||
mopinittable : PRTTIRecordOpOffsetTable;
|
||||
{$endif def FPC_HAS_FEATURE_RTTI}
|
||||
i : longint;
|
||||
i : longword;
|
||||
begin
|
||||
{ the size is saved at offset 0 }
|
||||
fillchar(instance^, InstanceSize, 0);
|
||||
@ -472,8 +473,14 @@ end;
|
||||
{$push}
|
||||
{ ensure that no range check errors pop up with the [0..0] array }
|
||||
{$R-}
|
||||
for i:=0 to mopinittable^.Count-1 do
|
||||
TRTTIRecVarOp(mopinittable^.Entries[i].ManagmentOperator)(PByte(Instance)+mopinittable^.Entries[i].FieldOffset);
|
||||
i:=mopinittable^.Count;
|
||||
Res:=@mopinittable^.Entries[0];
|
||||
while i>0 do
|
||||
begin
|
||||
TRTTIRecVarOp(Res^.ManagmentOperator)(PByte(Instance)+Res^.FieldOffset);
|
||||
inc(Res);
|
||||
dec(i);
|
||||
end;
|
||||
{$pop}
|
||||
end;
|
||||
end;
|
||||
@ -1010,7 +1017,7 @@ end;
|
||||
|
||||
class function TObject.GetInterfaceEntry(const iid : tguid) : pinterfaceentry;
|
||||
var
|
||||
i: longint;
|
||||
i: sizeuint;
|
||||
intftable: pinterfacetable;
|
||||
ovmt: PVmt;
|
||||
begin
|
||||
@ -1018,11 +1025,14 @@ end;
|
||||
while Assigned(ovmt) and Assigned(ovmt^.vIntftable) do
|
||||
begin
|
||||
intftable:=ovmt^.vIntfTable;
|
||||
for i:=0 to intftable^.EntryCount-1 do
|
||||
i:=intftable^.EntryCount;
|
||||
result:=@intftable^.Entries[0];
|
||||
while i>0 do
|
||||
begin
|
||||
result:=@intftable^.Entries[i];
|
||||
if assigned(Result^.iid) and IsGUIDEqual(Result^.iid^,iid) then
|
||||
Exit;
|
||||
inc(Result);
|
||||
dec(i);
|
||||
end;
|
||||
ovmt := ovmt^.vParent;
|
||||
end;
|
||||
@ -1031,7 +1041,7 @@ end;
|
||||
|
||||
class function TObject.GetInterfaceEntryByStr(const iidstr : shortstring) : pinterfaceentry;
|
||||
var
|
||||
i: longint;
|
||||
i: sizeuint;
|
||||
intftable: pinterfacetable;
|
||||
ovmt: PVmt;
|
||||
begin
|
||||
@ -1039,11 +1049,14 @@ end;
|
||||
while Assigned(ovmt) and Assigned(ovmt^.vIntfTable) do
|
||||
begin
|
||||
intftable:=ovmt^.vIntfTable;
|
||||
for i:=0 to intftable^.EntryCount-1 do
|
||||
i:=intftable^.EntryCount;
|
||||
result:=@intftable^.Entries[0];
|
||||
while i>0 do
|
||||
begin
|
||||
result:=@intftable^.Entries[i];
|
||||
if assigned(result^.iidstr) and (result^.iidstr^ = iidstr) then
|
||||
Exit;
|
||||
inc(Result);
|
||||
dec(i);
|
||||
end;
|
||||
ovmt := ovmt^.vParent;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user