mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-04 11:27:56 +02:00
* avoid overflow error in ispowerof2 for -2^bitsize, the routine does not handle negative values
git-svn-id: trunk@37963 -
This commit is contained in:
parent
5c1df42fa4
commit
823c77e6cc
@ -910,7 +910,7 @@ implementation
|
|||||||
return if value is a power of 2. And if correct return the power
|
return if value is a power of 2. And if correct return the power
|
||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
if (value = 0) or (value and (value - 1) <> 0) then
|
if (value <= 0) or (value and (value - 1) <> 0) then
|
||||||
exit(false);
|
exit(false);
|
||||||
power:=BsfQWord(value);
|
power:=BsfQWord(value);
|
||||||
result:=true;
|
result:=true;
|
||||||
|
Loading…
Reference in New Issue
Block a user