Browse Source

Avoid range check error for avr/i8086 CPU by changing local variable dist type to asizeuint

git-svn-id: trunk@42741 -
pierre 6 years ago
parent
commit
8fd0a27875
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/ncgset.pas

+ 2 - 2
compiler/ncgset.pas

@@ -1146,7 +1146,7 @@ implementation
       var
       var
          oldflowcontrol: tflowcontrol;
          oldflowcontrol: tflowcontrol;
          i : longint;
          i : longint;
-         dist : aword;
+         dist : asizeuint;
          distv,
          distv,
          lv,hv,
          lv,hv,
          max_label: tconstexprint;
          max_label: tconstexprint;
@@ -1235,7 +1235,7 @@ implementation
                    if distv>=0 then
                    if distv>=0 then
                      dist:=distv.uvalue
                      dist:=distv.uvalue
                    else
                    else
-                     dist:=aword(-distv.svalue);
+                     dist:=asizeuint(-distv.svalue);
 
 
                    { optimize for size ? }
                    { optimize for size ? }
                    if cs_opt_size in current_settings.optimizerswitches  then
                    if cs_opt_size in current_settings.optimizerswitches  then