* handle constructors correctly during dfa: the result note must point to self

* handle inline nodes correctly during dfa: they can create/destroy defs

git-svn-id: trunk@25965 -
This commit is contained in:
florian 2013-11-06 21:10:32 +00:00
parent 6f03d04fe1
commit fa8abf7fcb

View File

@ -473,8 +473,7 @@ unit optdfa;
exitn: exitn:
begin begin
if not(is_void(current_procinfo.procdef.returndef)) and if not(is_void(current_procinfo.procdef.returndef)) then
not(current_procinfo.procdef.proctypeoption=potype_constructor) then
begin begin
if not(assigned(node.optinfo^.def)) and if not(assigned(node.optinfo^.def)) and
not(assigned(node.optinfo^.use)) then not(assigned(node.optinfo^.use)) then
@ -500,6 +499,7 @@ unit optdfa;
end; end;
end; end;
inlinen,
calln: calln:
begin begin
if not(assigned(node.optinfo^.def)) and if not(assigned(node.optinfo^.def)) and
@ -515,7 +515,6 @@ unit optdfa;
tempcreaten, tempcreaten,
tempdeleten, tempdeleten,
inlinen,
nothingn, nothingn,
continuen, continuen,
goton, goton,
@ -539,10 +538,12 @@ unit optdfa;
dfarec : tdfainfo; dfarec : tdfainfo;
begin begin
runs:=0; runs:=0;
if not(is_void(current_procinfo.procdef.returndef)) and if not(is_void(current_procinfo.procdef.returndef)) then
not(current_procinfo.procdef.proctypeoption=potype_constructor) then
begin begin
{ create a fake node using the result } { create a fake node using the result }
if current_procinfo.procdef.proctypeoption=potype_constructor then
resultnode:=load_self_node
else
resultnode:=load_result_node; resultnode:=load_result_node;
resultnode.allocoptinfo; resultnode.allocoptinfo;
dfarec.use:=@resultnode.optinfo^.use; dfarec.use:=@resultnode.optinfo^.use;