소스 검색

* set nf_* correctly when an inc/dec node is converted into an add/sub node
* do not firstpass during dead store removal as it disturbes the for each calls

git-svn-id: trunk@44180 -

florian 5 년 전
부모
커밋
3947922fea
2개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      compiler/ninl.pas
  2. 3 2
      compiler/optdeadstore.pas

+ 3 - 0
compiler/ninl.pas

@@ -4367,6 +4367,9 @@ implementation
            end;
 
          resultnode := hp.getcopy;
+         { get varstates right }
+         node_reset_flags(resultnode,[nf_pass1_done,nf_modify]);
+
          { avoid type errors from the addn/subn }
          if not is_integer(resultnode.resultdef) then
            begin

+ 3 - 2
compiler/optdeadstore.pas

@@ -94,8 +94,9 @@ unit optdeadstore;
                         tstatementnode(n).statement.free;
 
                         tstatementnode(n).statement:=cnothingnode.create;
-                        Exclude(tstatementnode(n).flags, nf_pass1_done);
-                        do_firstpass(n);
+                        { do not run firstpass on n here, as it will remove the statement node
+                          and this will make foreachnodestatic process the wrong nodes as the current statement
+                          node will disappear }
                       end
                   end;
               end;