Browse Source

* inserted type casts on opr.val again, but depending on the type of opr.val, avoids range check errors

git-svn-id: trunk@38341 -
florian 7 years ago
parent
commit
3ca6034523
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/raatt.pas

+ 6 - 1
compiler/raatt.pas

@@ -1723,7 +1723,12 @@ unit raatt;
         else
          begin
            oper.opr.typ:=OPR_CONSTANT;
-           oper.opr.val:=l;
+           { cast properly to avoid a range check error }
+{$if defined(AVR) or defined(i8086)}
+           oper.opr.val:=longint(l);
+{$else}
+           oper.opr.val:=aint(l);
+{$endif}
          end;
       end;