mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 20:39:34 +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
|
||||
}
|
||||
begin
|
||||
if (value = 0) or (value and (value - 1) <> 0) then
|
||||
if (value <= 0) or (value and (value - 1) <> 0) then
|
||||
exit(false);
|
||||
power:=BsfQWord(value);
|
||||
result:=true;
|
||||
|
Loading…
Reference in New Issue
Block a user