Răsfoiți Sursa

* avoid spurious range errors due to longint+qword expressions (results in
both values getting converted to a qword, which causes a range error
in case the longint is smaller than 0)

git-svn-id: trunk@21621 -

Jonas Maebe 13 ani în urmă
părinte
comite
313e976256
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      compiler/x86/aasmcpu.pas

+ 6 - 0
compiler/x86/aasmcpu.pas

@@ -1038,8 +1038,11 @@ implementation
                         begin
                         begin
                           currsym:=objdata.symbolref(ref^.symbol);
                           currsym:=objdata.symbolref(ref^.symbol);
                           l:=ref^.offset;
                           l:=ref^.offset;
+{$push}
+{$r-}
                           if assigned(currsym) then
                           if assigned(currsym) then
                             inc(l,currsym.address);
                             inc(l,currsym.address);
+{$pop}
                           { when it is a forward jump we need to compensate the
                           { when it is a forward jump we need to compensate the
                             offset of the instruction since the previous time,
                             offset of the instruction since the previous time,
                             because the symbol address is then still using the
                             because the symbol address is then still using the
@@ -2212,8 +2215,11 @@ implementation
               begin
               begin
                 getvalsym(c-40);
                 getvalsym(c-40);
                 data:=currval-insend;
                 data:=currval-insend;
+{$push}
+{$r-}
                 if assigned(currsym) then
                 if assigned(currsym) then
                  inc(data,currsym.address);
                  inc(data,currsym.address);
+{$pop}
                 if (data>127) or (data<-128) then
                 if (data>127) or (data<-128) then
                  Message1(asmw_e_short_jmp_out_of_range,tostr(data));
                  Message1(asmw_e_short_jmp_out_of_range,tostr(data));
                 objdata.writebytes(data,1);
                 objdata.writebytes(data,1);