فهرست منبع

* simplify type conversions of ordinal constants to currency

git-svn-id: trunk@44055 -
florian 5 سال پیش
والد
کامیت
6a1c09bb43
1فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 10 0
      compiler/ncnv.pas

+ 10 - 0
compiler/ncnv.pas

@@ -2947,6 +2947,7 @@ implementation
     function ttypeconvnode.simplify(forinline : boolean): tnode;
     function ttypeconvnode.simplify(forinline : boolean): tnode;
       var
       var
         hp: tnode;
         hp: tnode;
+        v: Tconstexprint;
 {$ifndef CPUNO32BITOPS}
 {$ifndef CPUNO32BITOPS}
         foundsint: boolean;
         foundsint: boolean;
 {$endif not CPUNO32BITOPS}
 {$endif not CPUNO32BITOPS}
@@ -3133,6 +3134,15 @@ implementation
                    result:=left;
                    result:=left;
                    left:=nil;
                    left:=nil;
                    exit;
                    exit;
+                end
+              else if (convtype=tc_int_2_int) and
+                is_currency(resultdef) then
+                begin
+                  v:=tordconstnode(left).value;
+                  if not(nf_internal in flags) and not(is_currency(left.resultdef)) then
+                    v:=v*10000;
+                  result:=cordconstnode.create(v,resultdef,false);
+                  exit;
                 end;
                 end;
             end;
             end;