2
0
Эх сурвалжийг харах

Avoid overflow error for single MinValue in rtl syshelph.inc for x86_64 CPU

git-svn-id: trunk@33012 -
pierre 9 жил өмнө
parent
commit
1e5883b6d1
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      compiler/nmat.pas

+ 5 - 0
compiler/nmat.pas

@@ -858,8 +858,13 @@ implementation
         if is_constrealnode(left) then
           begin
              trealconstnode(left).value_real:=-trealconstnode(left).value_real;
+             { Avoid integer overflow on x86_64 CPU for currency value }
+             { i386 uses fildll/fchs/fistll instructions which never seem
+               to raise any coprocessor flags .. }
+             {$push}{$Q-}
              trealconstnode(left).value_currency:=-trealconstnode(left).value_currency;
              result:=left;
+             {$pop}
              left:=nil;
              exit;
           end;