* generate the procsymbol before generating the code for the procedure,

so that refences to this symbol are not treated as external

git-svn-id: trunk@2009 -
This commit is contained in:
Jonas Maebe 2005-12-20 17:52:08 +00:00
parent c221e00a2d
commit b954ea006e

View File

@ -608,7 +608,7 @@ implementation
oldprocinfo : tprocinfo;
oldaktmaxfpuregisters : longint;
oldfilepos : tfileposinfo;
templist : Taasmoutput;
templist, symlist : Taasmoutput;
headertai : tai;
curralign : longint;
begin
@ -637,6 +637,7 @@ implementation
aktbreaklabel:=nil;
aktcontinuelabel:=nil;
templist:=Taasmoutput.create;
symlist:=Taasmoutput.create;
{ add parast/localst to symtablestack }
add_to_symtablestack;
@ -682,6 +683,12 @@ implementation
set_first_temp_offset;
generate_parameter_info;
{ allocate the symbol associated with the procedure, so that }
{ references to itself are not treated as references to }
{ externals }
aktfilepos:=entrypos;
gen_proc_symbol(symlist);
{ Allocate space in temp/registers for parast and localst }
aktfilepos:=entrypos;
gen_alloc_symtable(aktproccode,procdef.parast);
@ -771,10 +778,9 @@ implementation
{ generate symbol and save end of header position }
aktfilepos:=entrypos;
gen_proc_symbol(templist);
headertai:=tai(templist.last);
headertai:=tai(symlist.last);
{ insert symbol }
aktproccode.insertlist(templist);
aktproccode.insertlist(symlist);
{ Free space in temp/registers for parast and localst, must be
done after gen_entry_code }