SynEdit: fix potential rangecheck in compare function

git-svn-id: trunk@61150 -
This commit is contained in:
martin 2019-05-05 15:30:00 +00:00
parent dec42c1e4d
commit 4d8827642a
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ interface
uses
Classes, SysUtils,
// LazUtils
LazMethodList,
LazMethodList, LazUtilities,
// LCL
LCLIntf, LCLType, LCLProc, Graphics, Controls, Clipbrd, ImgList,
// SynEdit
@ -1571,7 +1571,7 @@ end;
function TSynObjectListItem.Compare(Other: TSynObjectListItem): Integer;
begin
Result := PtrUInt(self) - PtrUInt(Other);
Result := ComparePointers(Pointer(self), Pointer(Other));
end;
constructor TSynObjectListItem.Create(AOwner: TComponent);

View File

@ -464,7 +464,7 @@ begin
Result := PixLine - Other.PixLine;
if Result <> 0 then exit;
{$PUSH}{$Q-} // Overflow is allowed to occur
Result := PtrUint(self) - PtrUInt(Other);
Result := Integer(PtrUint(self) - PtrUInt(Other));
{$POP}
end;