Explorar o código

* fixed inc/dec with constant truncating the high parts of the constant on
16-bit and 8-bit CPUs

git-svn-id: trunk@26908 -

nickysn %!s(int64=11) %!d(string=hai) anos
pai
achega
6e9083aa84
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      compiler/ncginl.pas

+ 6 - 1
compiler/ncginl.pas

@@ -431,7 +431,12 @@ implementation
               else
 {$endif not cpu64bitalu}
                 hlcg.a_op_const_loc(current_asmdata.CurrAsmList,addsubop[inlinenumber],left.resultdef,
-                  aint(addvalue.svalue),tcallparanode(left).left.location);
+{$ifdef cpu64bitalu}
+                  aint(addvalue.svalue),
+{$else cpu64bitalu}
+                  longint(addvalue.svalue),  // can't use aint, because it breaks 16-bit and 8-bit CPUs
+{$endif cpu64bitalu}
+                  tcallparanode(left).left.location);
             end
            else
              begin