2
0
Эх сурвалжийг харах

* 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 жил өмнө
parent
commit
3947922fea

+ 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;