From fa8abf7fcbb7e023a51c0ea5b6241f63852df4f5 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 6 Nov 2013 21:10:32 +0000 Subject: [PATCH] * 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 - --- compiler/optdfa.pas | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/optdfa.pas b/compiler/optdfa.pas index e4734bca55..1d4d5a1751 100644 --- a/compiler/optdfa.pas +++ b/compiler/optdfa.pas @@ -473,8 +473,7 @@ unit optdfa; exitn: begin - if not(is_void(current_procinfo.procdef.returndef)) and - not(current_procinfo.procdef.proctypeoption=potype_constructor) then + if not(is_void(current_procinfo.procdef.returndef)) then begin if not(assigned(node.optinfo^.def)) and not(assigned(node.optinfo^.use)) then @@ -500,6 +499,7 @@ unit optdfa; end; end; + inlinen, calln: begin if not(assigned(node.optinfo^.def)) and @@ -515,7 +515,6 @@ unit optdfa; tempcreaten, tempdeleten, - inlinen, nothingn, continuen, goton, @@ -539,11 +538,13 @@ unit optdfa; dfarec : tdfainfo; begin runs:=0; - if not(is_void(current_procinfo.procdef.returndef)) and - not(current_procinfo.procdef.proctypeoption=potype_constructor) then + if not(is_void(current_procinfo.procdef.returndef)) then begin { create a fake node using the result } - resultnode:=load_result_node; + if current_procinfo.procdef.proctypeoption=potype_constructor then + resultnode:=load_self_node + else + resultnode:=load_result_node; resultnode.allocoptinfo; dfarec.use:=@resultnode.optinfo^.use; dfarec.def:=@resultnode.optinfo^.def;