소스 검색

* 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