Pārlūkot izejas kodu

* also recognize scurrency as an "originally was a 64 bit value" in
try_make_mul32to64()
* when inserting a 32x32->64 multiplication, change the typeconversions
of the original nodes into internal type conversions, because they
may have been currency (e.g., in case of an integer-to-currency
conversion, which is performed via integer*currency(10000)) and
since r21097 implicit conversions from currency to ordinal are no
longer allowed

git-svn-id: trunk@21112 -

Jonas Maebe 13 gadi atpakaļ
vecāks
revīzija
06b17111da
1 mainītis faili ar 6 papildinājumiem un 6 dzēšanām
  1. 6 6
      compiler/nadd.pas

+ 6 - 6
compiler/nadd.pas

@@ -2487,11 +2487,11 @@ implementation
         result := false;
         result := false;
         if ((left.nodetype = typeconvn) and
         if ((left.nodetype = typeconvn) and
             is_integer(ttypeconvnode(left).left.resultdef) and
             is_integer(ttypeconvnode(left).left.resultdef) and
-            (not(torddef(ttypeconvnode(left).left.resultdef).ordtype in [u64bit,s64bit])) and
+            (not(torddef(ttypeconvnode(left).left.resultdef).ordtype in [u64bit,s64bit,scurrency])) and
            (((right.nodetype = ordconstn) and canbe32bitint(tordconstnode(right).value)) or
            (((right.nodetype = ordconstn) and canbe32bitint(tordconstnode(right).value)) or
             ((right.nodetype = typeconvn) and
             ((right.nodetype = typeconvn) and
              is_integer(ttypeconvnode(right).left.resultdef) and
              is_integer(ttypeconvnode(right).left.resultdef) and
-             not(torddef(ttypeconvnode(right).left.resultdef).ordtype in [u64bit,s64bit])) and
+             not(torddef(ttypeconvnode(right).left.resultdef).ordtype in [u64bit,s64bit,scurrency])) and
              ((is_signed(ttypeconvnode(left).left.resultdef) =
              ((is_signed(ttypeconvnode(left).left.resultdef) =
                is_signed(ttypeconvnode(right).left.resultdef)) or
                is_signed(ttypeconvnode(right).left.resultdef)) or
               (is_signed(ttypeconvnode(left).left.resultdef) and
               (is_signed(ttypeconvnode(left).left.resultdef) and
@@ -2510,13 +2510,13 @@ implementation
               end;
               end;
             if (is_signed(left.resultdef)) then
             if (is_signed(left.resultdef)) then
               begin
               begin
-                inserttypeconv(left,s32inttype);
-                inserttypeconv(right,s32inttype);
+                inserttypeconv_internal(left,s32inttype);
+                inserttypeconv_internal(right,s32inttype);
               end
               end
             else
             else
               begin
               begin
-                inserttypeconv(left,u32inttype);
-                inserttypeconv(right,u32inttype);
+                inserttypeconv_internal(left,u32inttype);
+                inserttypeconv_internal(right,u32inttype);
               end;
               end;
             firstpass(left);
             firstpass(left);
             firstpass(right);
             firstpass(right);