mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 21:49:15 +02:00
* 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:
parent
6f03d04fe1
commit
fa8abf7fcb
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user