mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 18:30:29 +02:00
* prevent overflow in fphash
git-svn-id: trunk@3130 -
This commit is contained in:
parent
a8c2419d8a
commit
1a3cf9650e
@ -1096,6 +1096,10 @@ end;
|
||||
Var
|
||||
p,pmax : pchar;
|
||||
begin
|
||||
{$ifopt Q+}
|
||||
{$define overflowon}
|
||||
{$Q-}
|
||||
{$endif}
|
||||
result:=0;
|
||||
p:=@s[1];
|
||||
pmax:=@s[length(s)+1];
|
||||
@ -1104,6 +1108,10 @@ end;
|
||||
result:=((result shl 5) - result) xor LongWord(P^);
|
||||
inc(p);
|
||||
end;
|
||||
{$ifdef overflowon}
|
||||
{$Q+}
|
||||
{$undef overflowon}
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user