mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 22:09:28 +02:00
SynEdit: fix potential rangecheck in compare function
git-svn-id: trunk@61150 -
This commit is contained in:
parent
dec42c1e4d
commit
4d8827642a
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user