ソースを参照

Change parameter type to tcgint for is_imm12 and is_lui_imm functions to avoid range check errors

git-svn-id: trunk@43609 -
pierre 5 年 前
コミット
fb33da5f41
2 ファイル変更8 行追加8 行削除
  1. 4 4
      compiler/riscv32/cpubase.pas
  2. 4 4
      compiler/riscv64/cpubase.pas

+ 4 - 4
compiler/riscv32/cpubase.pas

@@ -313,8 +313,8 @@ uses
                                   Helpers
                                   Helpers
 *****************************************************************************}
 *****************************************************************************}
 
 
-    function is_imm12(value: aint): boolean;
-    function is_lui_imm(value: aint): boolean;
+    function is_imm12(value: tcgint): boolean;
+    function is_lui_imm(value: tcgint): boolean;
 
 
     function is_calljmp(o:tasmop):boolean;
     function is_calljmp(o:tasmop):boolean;
 
 
@@ -359,13 +359,13 @@ implementation
                                   Helpers
                                   Helpers
 *****************************************************************************}
 *****************************************************************************}
 
 
-    function is_imm12(value: aint): boolean;
+    function is_imm12(value: tcgint): boolean;
       begin
       begin
         result:=(value >= -2048) and (value <= 2047);
         result:=(value >= -2048) and (value <= 2047);
       end;
       end;
 
 
 
 
-    function is_lui_imm(value: aint): boolean;
+    function is_lui_imm(value: tcgint): boolean;
       begin
       begin
         result:=SarInt64((value and $FFFFF000) shl 32, 32) = value;
         result:=SarInt64((value and $FFFFF000) shl 32, 32) = value;
       end;
       end;

+ 4 - 4
compiler/riscv64/cpubase.pas

@@ -328,8 +328,8 @@ const
                                     Helpers
                                     Helpers
   *****************************************************************************}
   *****************************************************************************}
 
 
-    function is_imm12(value: aint): boolean;
-    function is_lui_imm(value: aint): boolean;
+    function is_imm12(value: tcgint): boolean;
+    function is_lui_imm(value: tcgint): boolean;
 
 
     function is_calljmp(o:tasmop):boolean;
     function is_calljmp(o:tasmop):boolean;
 
 
@@ -374,13 +374,13 @@ implementation
                                   Helpers
                                   Helpers
 *****************************************************************************}
 *****************************************************************************}
 
 
-    function is_imm12(value: aint): boolean;
+    function is_imm12(value: tcgint): boolean;
       begin
       begin
         result:=(value >= -2048) and (value <= 2047);
         result:=(value >= -2048) and (value <= 2047);
       end;
       end;
 
 
 
 
-    function is_lui_imm(value: aint): boolean;
+    function is_lui_imm(value: tcgint): boolean;
       begin
       begin
         result:=SarInt64((value and $FFFFF000) shl 32, 32) = value;
         result:=SarInt64((value and $FFFFF000) shl 32, 32) = value;
       end;
       end;