[cc65] Re: cc65 forgetting to emit labels

From: Alan Cox <etchedpixels1gmail.com>
Date: 2014-10-02 12:11:45
Further follow up. The problem seems to be that the compiler tried to parse the
"(int (*)())udata.u_argn1" with ParseFuncDecl which creates a new
lexical level and then does a RememberFunctionalLevel() which blows
away the labels.

I believe the correct fix is attached.

This restores the labels after parsing the function. If this instance
is actually a function proper rather than a declaration it will go via
ReenterFunctionalLevel() which does blow away the labels correctly.

I've tested that

int one(void)
{
hello: goto hello;
}

int two(void)
{
  goto hello;
}

still correctly errors, and it does so.

With this change my code builds. It's noticeably bigger on 6502 (46K v
40K on Z80 and about 35K on 6809) but I guess that's to be expected.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Oct 2 12:12:03 2014

This archive was generated by hypermail 2.1.8 : 2014-10-02 12:12:06 CEST