瀏覽代碼

* fixed overflow errors

git-svn-id: trunk@5318 -
Jonas Maebe 18 年之前
父節點
當前提交
d26ee9dccf
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      compiler/powerpc/aoptcpu.pas

+ 3 - 3
compiler/powerpc/aoptcpu.pas

@@ -207,11 +207,11 @@ const
     begin
        // 1 shl 32 = 1 instead of 0 on x86
       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
-        result := not(1 shl (31 - l2) - 1);
+        result := longint(not(cardinal(1) shl (31 - l2) - 1));
       if (l1 > l2) then
-        result := not(result);        
+        result := not(result);
     end;