mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 20:39:24 +02:00
* 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:
parent
f32d7898f8
commit
3947922fea
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user