mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 00:50:17 +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
|
Var
|
||||||
p,pmax : pchar;
|
p,pmax : pchar;
|
||||||
begin
|
begin
|
||||||
|
{$ifopt Q+}
|
||||||
|
{$define overflowon}
|
||||||
|
{$Q-}
|
||||||
|
{$endif}
|
||||||
result:=0;
|
result:=0;
|
||||||
p:=@s[1];
|
p:=@s[1];
|
||||||
pmax:=@s[length(s)+1];
|
pmax:=@s[length(s)+1];
|
||||||
@ -1104,6 +1108,10 @@ end;
|
|||||||
result:=((result shl 5) - result) xor LongWord(P^);
|
result:=((result shl 5) - result) xor LongWord(P^);
|
||||||
inc(p);
|
inc(p);
|
||||||
end;
|
end;
|
||||||
|
{$ifdef overflowon}
|
||||||
|
{$Q+}
|
||||||
|
{$undef overflowon}
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user