Browse Source

* better constant propation for inline nodes

florian 3 years ago
parent
commit
c79df5f0fc
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/optconstprop.pas

+ 4 - 2
compiler/optconstprop.pas

@@ -214,12 +214,14 @@ unit optconstprop;
                     result:=false;
                     result:=false;
                     exit;
                     exit;
                   end;
                   end;
+                { inc/dec might have a side effect, so stop here for now }
+                result:=false;
+                exit;
               end
               end
             else if might_have_sideeffects(n) then
             else if might_have_sideeffects(n) then
               exit(false);
               exit(false);
 
 
-            replaceBasicAssign(tunarynode(n).left, arg, tree_modified);
-            result:=false;
+            result:=replaceBasicAssign(tunarynode(n).left, arg, tree_modified);
           end
           end
         else if n.nodetype=calln then
         else if n.nodetype=calln then
           begin
           begin