mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-10 08:50:07 +08:00
Allow declarations in case statement
This now works: case 1: int z = 123; break;
This commit is contained in:
parent
04365dd4c9
commit
bbe2e5a421
2
tccgen.c
2
tccgen.c
@ -7266,7 +7266,7 @@ again:
|
||||
if (is_expr) {
|
||||
vpop();
|
||||
gexpr();
|
||||
} else {
|
||||
} else if (!decl(VT_JMP)) {
|
||||
gexpr();
|
||||
vpop();
|
||||
}
|
||||
|
@ -14,7 +14,8 @@ int main()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
printf("%d\n", 2);
|
||||
int a = 2;
|
||||
printf("%d\n", a);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user