Skip to content

Commit

Permalink
Nested functions will now be correctly handled (See Walters comments).
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Wilson committed Jan 10, 2013
1 parent 62dead4 commit 7a3a17e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,13 @@ int FuncDeclaration::equals(Object *o)
void FuncDeclaration::bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
if (fbody && (!hgs->hdrgen || global.params.useInline || hgs->autoMember || hgs->tpltMember))
{ buf->writenl();
{
int savetlpt = hgs->tpltMember;
int saveauto = hgs->autoMember;
hgs->tpltMember = 0;
hgs->autoMember = 0;

buf->writenl();

// in{}
if (frequire)
Expand Down Expand Up @@ -1842,6 +1848,9 @@ void FuncDeclaration::bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs)
buf->level--;
buf->writebyte('}');
buf->writenl();

hgs->tpltMember = savetlpt;
hgs->autoMember = saveauto;
}
else
{
Expand Down

0 comments on commit 7a3a17e

Please sign in to comment.