Allow declarations in case statement

This now works:

 case 1:
    int z = 123;
    break;
This commit is contained in:
herman ten brugge 2024-01-16 07:51:56 +01:00
parent 04365dd4c9
commit bbe2e5a421
2 changed files with 3 additions and 2 deletions

View File

@ -7266,7 +7266,7 @@ again:
if (is_expr) { if (is_expr) {
vpop(); vpop();
gexpr(); gexpr();
} else { } else if (!decl(VT_JMP)) {
gexpr(); gexpr();
vpop(); vpop();
} }

View File

@ -14,7 +14,8 @@ int main()
break; break;
case 2: case 2:
printf("%d\n", 2); int a = 2;
printf("%d\n", a);
break; break;
default: default: