Missing colon after case causes null reference in parser
compilation fails with segmentation fault on this code (case 2 without colon):
void main() {
int a = 0;
switch (a) {
case 1:
a--;
break;
case 2
if (a>0) a++;
break;
default:
a = 0;
break;
}
}
When it returns to parse_statements (in valaparser.vala, after an exception) and recover state to case 2, it recognize case' and
2' as different statements and adds it to block. But when starts to parse next statement (for example `if') in tokens buffer after IF token is not OPEN_PARENS but other thing. I don't know was this bug registered or not.
Edited by Rico Tzschichholz