* moved initialisation of parentfpstruct to just behind where the local vars

get initialised, so that parameters in this struct are already available
    in any wrappers generated for the parent routine (e.g. in case self is
    moved to the parentfpstruct in a destructor, which calls beforestruction
    in its wrapper)

git-svn-id: trunk@40384 -
This commit is contained in:
Jonas Maebe 2018-11-28 19:23:28 +00:00
parent 97b40dc16d
commit 3a5a69619e

View File

@ -892,6 +892,18 @@ implementation
addstatement(newstatement,entry_asmnode); addstatement(newstatement,entry_asmnode);
cnodeutils.procdef_block_add_implicit_initialize_nodes(procdef,newstatement); cnodeutils.procdef_block_add_implicit_initialize_nodes(procdef,newstatement);
addstatement(newstatement,init_asmnode); addstatement(newstatement,init_asmnode);
if assigned(procdef.parentfpinitblock) then
begin
if assigned(tblocknode(procdef.parentfpinitblock).left) then
begin
{ could be an asmn in case of a pure assembler procedure,
but those shouldn't access nested variables }
addstatement(newstatement,procdef.parentfpinitblock);
end
else
procdef.parentfpinitblock.free;
procdef.parentfpinitblock:=nil;
end;
addstatement(newstatement,bodyentrycode); addstatement(newstatement,bodyentrycode);
if (cs_implicit_exceptions in current_settings.moduleswitches) and if (cs_implicit_exceptions in current_settings.moduleswitches) and
@ -1875,6 +1887,7 @@ implementation
old_current_structdef: tabstractrecorddef; old_current_structdef: tabstractrecorddef;
old_current_genericdef, old_current_genericdef,
old_current_specializedef: tstoreddef; old_current_specializedef: tstoreddef;
parentfpinitblock: tnode;
old_parse_generic: boolean; old_parse_generic: boolean;
recordtokens : boolean; recordtokens : boolean;
@ -1987,16 +2000,10 @@ implementation
begin begin
if assigned(tblocknode(procdef.parentfpinitblock).left) then if assigned(tblocknode(procdef.parentfpinitblock).left) then
begin begin
{ could be an asmn in case of a pure assembler procedure, parentfpinitblock:=procdef.parentfpinitblock;
but those shouldn't access nested variables } do_typecheckpass(parentfpinitblock);
if code.nodetype<>blockn then procdef.parentfpinitblock:=parentfpinitblock;
internalerror(2015122601);
tblocknode(code).left:=cstatementnode.create(procdef.parentfpinitblock,tblocknode(code).left);
do_typecheckpass(tblocknode(code).left);
end end
else
procdef.parentfpinitblock.free;
procdef.parentfpinitblock:=nil;
end; end;
end; end;