Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label defs should be propagated from inside stmtExpr #78

Open
krame505 opened this issue Oct 16, 2017 · 0 comments
Open

Label defs should be propagated from inside stmtExpr #78

krame505 opened this issue Oct 16, 2017 · 0 comments
Labels

Comments

@krame505
Copy link
Member

Currently we only propagate label defs across statements. However, labels may occur inside statements inside expressions inside statements, and should be visible at the top level of statements.

Note that goto isn't allowed to such labels directly, but computed goto (which we don't support at all right now...) should be allowed, so we will need to introduce some method of distinguishing whether a label in the environment is nested inside the environment or not.
For example, this should not be allowed:

int main(void) 
{   
    ({l1: ; 0;});
    goto l1;
    return 0;
}

but this should:

int main(void) 
{   
    ({l1: ; 0;});
    void *ptr = &&l1;
    goto *ptr;
    return 0;
}

This is a seperate issue from #77, although that redesign should probably happen first.

@krame505 krame505 added the bug label Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant