Browse Source

* avoid range check errors

git-svn-id: trunk@39990 -
florian 6 năm trước cách đây
mục cha
commit
116f36fe56

+ 2 - 2
compiler/nadd.pas

@@ -377,7 +377,7 @@ implementation
 
 
     function taddnode.simplify(forinline : boolean) : tnode;
     function taddnode.simplify(forinline : boolean) : tnode;
 
 
-      function is_range_test(nodel, noder: taddnode; var value: tnode; var cl,cr: qword): boolean;
+      function is_range_test(nodel, noder: taddnode; var value: tnode; var cl,cr: Tconstexprint): boolean;
         const
         const
           is_upper_test: array[ltn..gten] of boolean = (true,true,false,false);
           is_upper_test: array[ltn..gten] of boolean = (true,true,false,false);
           inclusive_adjust: array[boolean,ltn..gten] of integer = ((1,0,-1,0),
           inclusive_adjust: array[boolean,ltn..gten] of integer = ((1,0,-1,0),
@@ -460,7 +460,7 @@ implementation
         resultset : Tconstset;
         resultset : Tconstset;
         res,
         res,
         b       : boolean;
         b       : boolean;
-        cr, cl  : qword;
+        cr, cl  : Tconstexprint;
       begin
       begin
         result:=nil;
         result:=nil;
         l1:=0;
         l1:=0;

+ 2 - 1
compiler/powerpc/rappcgas.pas

@@ -159,7 +159,8 @@ Unit rappcgas;
                End
                End
               Else
               Else
                Begin
                Begin
-                 oper.opr.Ref.Offset:=BuildConstExpression(false,true);
+                 { cast explicitly to avoid range check errors }
+                 oper.opr.Ref.Offset:=ASizeInt(BuildConstExpression(false,true));
                  Consume(AS_RPAREN);
                  Consume(AS_RPAREN);
                  if actasmtoken=AS_AT then
                  if actasmtoken=AS_AT then
                    ReadAt(oper);
                    ReadAt(oper);