Re: [cc65] Re: cc65 forgetting to emit labels

From: S.A. <vorsichtphysiker1gmx.net>
Date: 2014-10-02 20:19:04
I think, it is a different thing. The preprocessor does not know any 
scope it just replace
text with other text.

Am 02.10.2014 12:11, schrieb Alan Cox:
> 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 20:19:23 2014

This archive was generated by hypermail 2.1.8 : 2014-10-02 20:19:25 CEST