Skip to content

Commit eac1f82

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in JIT
1 parent 47259ee commit eac1f82

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
@@ -674,6 +674,7 @@ static int zend_may_overflow(const zend_op *opline, const zend_ssa_op *ssa_op, c
674674
ssa->var_info[res].range.underflow ||
675675
ssa->var_info[res].range.overflow);
676676
}
677+
fallthrough;
677678
default:
678679
return 1;
679680
}
@@ -2739,7 +2740,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27392740
goto done;
27402741
case ZEND_DO_UCALL:
27412742
is_terminated = 1;
2742-
/* break missing intentionally */
2743+
fallthrough;
27432744
case ZEND_DO_ICALL:
27442745
case ZEND_DO_FCALL_BY_NAME:
27452746
case ZEND_DO_FCALL:
@@ -2924,7 +2925,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
29242925
}
29252926
goto done;
29262927
}
2927-
/* break missing intentionally */
2928+
fallthrough;
29282929
case ZEND_JMPZNZ:
29292930
case ZEND_JMPZ_EX:
29302931
case ZEND_JMPNZ_EX:
@@ -3320,7 +3321,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
33203321
}
33213322
goto done;
33223323
}
3323-
/* break missing intentionally */
3324+
fallthrough;
33243325
case ZEND_JMPZ_EX:
33253326
case ZEND_JMPNZ_EX:
33263327
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;
@@ -526,7 +526,7 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_is_helper(zend_array *ht, zval *dim
526526
goto str_index;
527527
case IS_UNDEF:
528528
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
529-
/* break missing intentionally */
529+
fallthrough;
530530
case IS_NULL:
531531
offset_key = ZSTR_EMPTY_ALLOC();
532532
goto str_index;
@@ -595,7 +595,7 @@ static int ZEND_FASTCALL zend_jit_fetch_dim_isset_helper(zend_array *ht, zval *d
595595
goto str_index;
596596
case IS_UNDEF:
597597
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
598-
/* break missing intentionally */
598+
fallthrough;
599599
case IS_NULL:
600600
offset_key = ZSTR_EMPTY_ALLOC();
601601
goto str_index;
@@ -664,7 +664,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
664664
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
665665
return NULL;
666666
}
667-
/* break missing intentionally */
667+
fallthrough;
668668
case IS_NULL:
669669
offset_key = ZSTR_EMPTY_ALLOC();
670670
goto str_index;
@@ -745,7 +745,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
745745
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
746746
return NULL;
747747
}
748-
/* break missing intentionally */
748+
fallthrough;
749749
case IS_NULL:
750750
offset_key = ZSTR_EMPTY_ALLOC();
751751
goto str_index;
@@ -817,6 +817,7 @@ static zend_never_inline zend_long zend_check_string_offset(zval *dim/*, int typ
817817
}
818818
case IS_UNDEF:
819819
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
820+
fallthrough;
820821
case IS_DOUBLE:
821822
case IS_NULL:
822823
case IS_FALSE:

ext/opcache/jit/zend_jit_trace.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
14201420
if (opline->result_type != IS_UNUSED) {
14211421
break;
14221422
}
1423-
/* break missing intentionally */
1423+
fallthrough;
14241424
case ZEND_ASSIGN_DIM:
14251425
if (opline->op1_type == IS_CV) {
14261426
ADD_OP1_DATA_TRACE_GUARD();
@@ -1444,7 +1444,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
14441444
if (opline->result_type != IS_UNUSED) {
14451445
break;
14461446
}
1447-
/* break missing intentionally */
1447+
fallthrough;
14481448
case ZEND_ASSIGN_OBJ:
14491449
case ZEND_PRE_INC_OBJ:
14501450
case ZEND_PRE_DEC_OBJ:
@@ -1481,7 +1481,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
14811481
case ZEND_CONCAT:
14821482
case ZEND_FAST_CONCAT:
14831483
ADD_OP2_TRACE_GUARD();
1484-
/* break missing intentionally */
1484+
fallthrough;
14851485
case ZEND_ECHO:
14861486
case ZEND_STRLEN:
14871487
case ZEND_QM_ASSIGN:
@@ -1543,7 +1543,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15431543
/* smart branch */
15441544
break;
15451545
}
1546-
/* break missing intentionally */
1546+
fallthrough;
15471547
case ZEND_JMPZNZ:
15481548
case ZEND_JMPZ_EX:
15491549
case ZEND_JMPNZ_EX:
@@ -1569,7 +1569,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15691569
// TODO: support for empty() ???
15701570
break;
15711571
}
1572-
/* break missing intentionally */
1572+
fallthrough;
15731573
case ZEND_FETCH_DIM_R:
15741574
case ZEND_FETCH_DIM_IS:
15751575
case ZEND_FETCH_LIST_R:
@@ -1616,7 +1616,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
16161616
if (opline->op2.num > MAX_ARG_FLAG_NUM) {
16171617
goto propagate_arg;
16181618
}
1619-
/* break missing intentionally */
1619+
fallthrough;
16201620
case ZEND_SEND_VAL:
16211621
case ZEND_SEND_VAR:
16221622
case ZEND_SEND_VAR_NO_REF:
@@ -1697,7 +1697,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
16971697
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(frame->call)) {
16981698
break;
16991699
}
1700-
/* break missing intentionally */
1700+
fallthrough;
17011701
case ZEND_FETCH_OBJ_R:
17021702
case ZEND_FETCH_OBJ_IS:
17031703
case ZEND_FETCH_OBJ_W:
@@ -4076,7 +4076,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
40764076
if (opline->extended_value != op1_type) {
40774077
break;
40784078
}
4079-
/* break missing intentionally */
4079+
fallthrough;
40804080
case ZEND_QM_ASSIGN:
40814081
op1_addr = OP1_REG_ADDR();
40824082
if (ra
@@ -4415,7 +4415,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
44154415
/* smart branch */
44164416
break;
44174417
}
4418-
/* break missing intentionally */
4418+
fallthrough;
44194419
case ZEND_JMPZNZ:
44204420
case ZEND_JMPZ_EX:
44214421
case ZEND_JMPNZ_EX:
@@ -4560,7 +4560,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
45604560
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) {
45614561
break;
45624562
}
4563-
/* break missing intentionally */
4563+
fallthrough;
45644564
case ZEND_FETCH_DIM_R:
45654565
case ZEND_FETCH_DIM_IS:
45664566
case ZEND_FETCH_LIST_R:
@@ -4758,7 +4758,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
47584758
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) {
47594759
break;
47604760
}
4761-
/* break missing intentionally */
4761+
fallthrough;
47624762
case ZEND_FETCH_OBJ_R:
47634763
case ZEND_FETCH_OBJ_IS:
47644764
case ZEND_FETCH_OBJ_W:

0 commit comments

Comments
 (0)