Explorar o código

* avoid overflow error in ispowerof2 for -2^bitsize, the routine does not handle negative values

git-svn-id: trunk@37963 -
florian %!s(int64=7) %!d(string=hai) anos
pai
achega
823c77e6cc
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      compiler/cutils.pas

+ 1 - 1
compiler/cutils.pas

@@ -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;