mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
22 lines
646 B
Java
22 lines
646 B
Java
public class Test {
|
|
void test_case_label_only_in_switch(int p) {
|
|
switch (p) {
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
notcaselabelnotinswitch: for (;;) {}
|
|
}
|
|
|
|
void test_noncase_label_in_switch(int p) {
|
|
switch (p) {
|
|
case 1:
|
|
notcaselabel1:; // $ Alert | Possibly erroneous non-case label in switch statement. The case keyword might be missing.
|
|
break;
|
|
case 2:
|
|
notcaselabel2: for (;;) { break notcaselabel2; } // $ Alert | Confusing non-case label in switch statement.
|
|
break;
|
|
}
|
|
}
|
|
}
|