* finalizetemps nodes should never be considered equal and have side effects

git-svn-id: trunk@40348 -
This commit is contained in:
Jonas Maebe 2018-11-18 11:07:28 +00:00
parent 0052e4da81
commit ea69a5b372
2 changed files with 8 additions and 1 deletions

View File

@ -63,6 +63,7 @@ interface
constructor create;virtual;
function pass_1 : tnode;override;
function pass_typecheck:tnode;override;
function docompare(p: tnode): boolean; override;
end;
tfinalizetempsnodeclass = class of tfinalizetempsnode;
@ -484,6 +485,12 @@ implementation
result:=nil;
end;
function tfinalizetempsnode.docompare(p: tnode): boolean;
begin
{ these nodes should never be coalesced }
result:=false;
end;
{*****************************************************************************
TSTATEMENTNODE

View File

@ -1342,7 +1342,7 @@ implementation
function check_for_sideeffect(var n: tnode; arg: pointer): foreachnoderesult;
begin
result:=fen_false;
if (n.nodetype in [assignn,calln,asmn]) or
if (n.nodetype in [assignn,calln,asmn,finalizetempsn]) or
((n.nodetype=inlinen) and
(tinlinenode(n).inlinenumber in [in_write_x,in_writeln_x,in_read_x,in_readln_x,in_str_x_string,
in_val_x,in_reset_x,in_rewrite_x,in_reset_typedfile,in_rewrite_typedfile,