* 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 -
This commit is contained in:
florian 2020-02-15 13:53:16 +00:00
parent f32d7898f8
commit 3947922fea
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

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