Skip to content

Commit e842945

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in JIT
1 parent cd7ee44 commit e842945

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ static int zend_may_overflow(const zend_op *opline, const zend_ssa_op *ssa_op, c
676676
ssa->var_info[res].range.underflow ||
677677
ssa->var_info[res].range.overflow);
678678
}
679+
fallthrough;
679680
default:
680681
return 1;
681682
}
@@ -2798,7 +2799,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27982799
goto done;
27992800
case ZEND_DO_UCALL:
28002801
is_terminated = 1;
2801-
/* break missing intentionally */
2802+
fallthrough;
28022803
case ZEND_DO_ICALL:
28032804
case ZEND_DO_FCALL_BY_NAME:
28042805
case ZEND_DO_FCALL:
@@ -2987,7 +2988,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
29872988
}
29882989
goto done;
29892990
}
2990-
/* break missing intentionally */
2991+
fallthrough;
29912992
case ZEND_JMPZNZ:
29922993
case ZEND_JMPZ_EX:
29932994
case ZEND_JMPNZ_EX:
@@ -3383,7 +3384,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
33833384
}
33843385
goto done;
33853386
}
3386-
/* break missing intentionally */
3387+
fallthrough;
33873388
case ZEND_JMPZ_EX:
33883389
case ZEND_JMPNZ_EX:
33893390
case ZEND_JMP_SET:

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_r_helper(zend_array *ht, zval *dim,
454454
goto str_index;
455455
case IS_UNDEF:
456456
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
457-
/* break missing intentionally */
457+
fallthrough;
458458
case IS_NULL:
459459
offset_key = ZSTR_EMPTY_ALLOC();
460460
goto str_index;
@@ -529,7 +529,7 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_is_helper(zend_array *ht, zval *dim
529529
goto str_index;
530530
case IS_UNDEF:
531531
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
532-
/* break missing intentionally */
532+
fallthrough;
533533
case IS_NULL:
534534
offset_key = ZSTR_EMPTY_ALLOC();
535535
goto str_index;
@@ -601,7 +601,7 @@ static int ZEND_FASTCALL zend_jit_fetch_dim_isset_helper(zend_array *ht, zval *d
601601
goto str_index;
602602
case IS_UNDEF:
603603
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
604-
/* break missing intentionally */
604+
fallthrough;
605605
case IS_NULL:
606606
offset_key = ZSTR_EMPTY_ALLOC();
607607
goto str_index;
@@ -673,7 +673,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
673673
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
674674
return NULL;
675675
}
676-
/* break missing intentionally */
676+
fallthrough;
677677
case IS_NULL:
678678
offset_key = ZSTR_EMPTY_ALLOC();
679679
goto str_index;
@@ -757,7 +757,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
757757
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
758758
return NULL;
759759
}
760-
/* break missing intentionally */
760+
fallthrough;
761761
case IS_NULL:
762762
offset_key = ZSTR_EMPTY_ALLOC();
763763
goto str_index;
@@ -832,6 +832,7 @@ static zend_never_inline zend_long zend_check_string_offset(zval *dim/*, int typ
832832
}
833833
case IS_UNDEF:
834834
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
835+
fallthrough;
835836
case IS_DOUBLE:
836837
case IS_NULL:
837838
case IS_FALSE:

ext/opcache/jit/zend_jit_trace.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15041504
if (opline->result_type != IS_UNUSED) {
15051505
break;
15061506
}
1507-
/* break missing intentionally */
1507+
fallthrough;
15081508
case ZEND_ASSIGN_DIM:
15091509
if (opline->op1_type == IS_CV) {
15101510
ADD_OP1_DATA_TRACE_GUARD();
@@ -1528,7 +1528,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15281528
if (opline->result_type != IS_UNUSED) {
15291529
break;
15301530
}
1531-
/* break missing intentionally */
1531+
fallthrough;
15321532
case ZEND_ASSIGN_OBJ:
15331533
case ZEND_PRE_INC_OBJ:
15341534
case ZEND_PRE_DEC_OBJ:
@@ -1565,7 +1565,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15651565
case ZEND_CONCAT:
15661566
case ZEND_FAST_CONCAT:
15671567
ADD_OP2_TRACE_GUARD();
1568-
/* break missing intentionally */
1568+
fallthrough;
15691569
case ZEND_ECHO:
15701570
case ZEND_STRLEN:
15711571
case ZEND_QM_ASSIGN:
@@ -1627,7 +1627,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
16271627
/* smart branch */
16281628
break;
16291629
}
1630-
/* break missing intentionally */
1630+
fallthrough;
16311631
case ZEND_JMPZNZ:
16321632
case ZEND_JMPZ_EX:
16331633
case ZEND_JMPNZ_EX:
@@ -1653,7 +1653,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
16531653
// TODO: support for empty() ???
16541654
break;
16551655
}
1656-
/* break missing intentionally */
1656+
fallthrough;
16571657
case ZEND_FETCH_DIM_R:
16581658
case ZEND_FETCH_DIM_IS:
16591659
case ZEND_FETCH_LIST_R:
@@ -1704,7 +1704,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
17041704
if (opline->op2.num > MAX_ARG_FLAG_NUM) {
17051705
goto propagate_arg;
17061706
}
1707-
/* break missing intentionally */
1707+
fallthrough;
17081708
case ZEND_SEND_VAL:
17091709
case ZEND_SEND_VAR:
17101710
case ZEND_SEND_VAR_NO_REF:
@@ -1794,7 +1794,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
17941794
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(frame->call)) {
17951795
break;
17961796
}
1797-
/* break missing intentionally */
1797+
fallthrough;
17981798
case ZEND_FETCH_OBJ_R:
17991799
case ZEND_FETCH_OBJ_IS:
18001800
case ZEND_FETCH_OBJ_W:
@@ -4393,7 +4393,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
43934393
if (opline->extended_value != op1_type) {
43944394
break;
43954395
}
4396-
/* break missing intentionally */
4396+
fallthrough;
43974397
case ZEND_QM_ASSIGN:
43984398
op1_addr = OP1_REG_ADDR();
43994399
if (ra
@@ -4763,7 +4763,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
47634763
/* smart branch */
47644764
break;
47654765
}
4766-
/* break missing intentionally */
4766+
fallthrough;
47674767
case ZEND_JMPZNZ:
47684768
case ZEND_JMPZ_EX:
47694769
case ZEND_JMPNZ_EX:
@@ -4908,7 +4908,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
49084908
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) {
49094909
break;
49104910
}
4911-
/* break missing intentionally */
4911+
fallthrough;
49124912
case ZEND_FETCH_DIM_R:
49134913
case ZEND_FETCH_DIM_IS:
49144914
case ZEND_FETCH_LIST_R:
@@ -5106,7 +5106,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
51065106
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) {
51075107
break;
51085108
}
5109-
/* break missing intentionally */
5109+
fallthrough;
51105110
case ZEND_FETCH_OBJ_R:
51115111
case ZEND_FETCH_OBJ_IS:
51125112
case ZEND_FETCH_OBJ_W:

0 commit comments

Comments
 (0)