瀏覽代碼

* better constant propation for inline nodes

florian 3 年之前
父節點
當前提交
c79df5f0fc
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      compiler/optconstprop.pas

+ 4 - 2
compiler/optconstprop.pas

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