ableC
ableC copied to clipboard
Label defs should be propagated from inside stmtExpr
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.