diff --git a/source/compiler/sc.h b/source/compiler/sc.h index 1a517a4..e6e5a26 100644 --- a/source/compiler/sc.h +++ b/source/compiler/sc.h @@ -640,7 +640,7 @@ SC_FUNC void setlinedirect(int line); SC_FUNC void setlineconst(int line); SC_FUNC void setlabel(int index); SC_FUNC void markexpr(optmark type,const char *name,cell offset); -SC_FUNC void startfunc(char *fname); +SC_FUNC void startfunc(char *fname,int generateproc); SC_FUNC void endfunc(void); SC_FUNC void alignframe(int numbytes); SC_FUNC void rvalue(value *lval); diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index b3eddeb..3cb0eff 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -3798,7 +3798,7 @@ static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int stoc ptr=ptr->next; } /* while */ } /* if */ - startfunc(sym->name); /* creates stack frame */ + startfunc(sym->name,(sym->flags & flagNAKED)==0); /* creates stack frame */ insert_dbgline(funcline); setline(FALSE); if (sc_alignnext) { diff --git a/source/compiler/sc4.c b/source/compiler/sc4.c index f2dd349..576c16b 100644 --- a/source/compiler/sc4.c +++ b/source/compiler/sc4.c @@ -343,9 +343,12 @@ SC_FUNC void markexpr(optmark type,const char *name,cell offset) * * Global references: funcstatus (referred to only) */ -SC_FUNC void startfunc(char *fname) +SC_FUNC void startfunc(char *fname,int generateproc) { - stgwrite("\tproc"); + if (generateproc) { + stgwrite("\tproc"); + code_idx+=opcodes(1); + } /* if */ if (sc_asmfile) { char symname[2*sNAMEMAX+16]; funcdisplayname(symname,fname); @@ -353,7 +356,6 @@ SC_FUNC void startfunc(char *fname) stgwrite(symname); } /* if */ stgwrite("\n"); - code_idx+=opcodes(1); } /* endfunc