Ver código fonte

+ handle constint+pointerconst in taddnode.simplify

git-svn-id: trunk@27491 -
nickysn 11 anos atrás
pai
commit
4563b2994d
1 arquivos alterados com 6 adições e 1 exclusões
  1. 6 1
      compiler/nadd.pas

+ 6 - 1
compiler/nadd.pas

@@ -419,6 +419,11 @@ implementation
              is_constintnode(right) and
              (nodetype in [addn,subn])
             ) or
+            (
+             (rt = pointerconstn) and
+             is_constintnode(left) and
+             (nodetype=addn)
+            ) or
             (
              (lt in [pointerconstn,niln]) and
              (rt in [pointerconstn,niln]) and
@@ -460,7 +465,7 @@ implementation
                        { Recover }
                        t:=genintconstnode(0)
                      end
-                   else if (lt=pointerconstn) then
+                   else if (lt=pointerconstn) or (rt=pointerconstn) then
                      t := cpointerconstnode.create(qword(v),resultdef)
                    else
                      if is_integer(ld) then