mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 06:49:23 +02:00
* fixed overflow errors
git-svn-id: trunk@5318 -
This commit is contained in:
parent
b8c3fecd1d
commit
d26ee9dccf
@ -207,9 +207,9 @@ const
|
|||||||
begin
|
begin
|
||||||
// 1 shl 32 = 1 instead of 0 on x86
|
// 1 shl 32 = 1 instead of 0 on x86
|
||||||
if (l1 <> 0) then
|
if (l1 <> 0) then
|
||||||
result := (1 shl (32 - l1) - 1) xor (1 shl (31 - l2) - 1)
|
result := longint(cardinal(1) shl (32 - l1) - 1) xor (cardinal(1) shl (31 - l2) - 1)
|
||||||
else
|
else
|
||||||
result := not(1 shl (31 - l2) - 1);
|
result := longint(not(cardinal(1) shl (31 - l2) - 1));
|
||||||
if (l1 > l2) then
|
if (l1 > l2) then
|
||||||
result := not(result);
|
result := not(result);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user