Skip to content

Commit b34d0e3

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in JIT
1 parent 58ebfd8 commit b34d0e3

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
}
@@ -2741,7 +2742,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27412742
goto done;
27422743
case ZEND_DO_UCALL:
27432744
is_terminated = 1;
2744-
/* break missing intentionally */
2745+
fallthrough;
27452746
case ZEND_DO_ICALL:
27462747
case ZEND_DO_FCALL_BY_NAME:
27472748
case ZEND_DO_FCALL:
@@ -2926,7 +2927,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
29262927
}
29272928
goto done;
29282929
}
2929-
/* break missing intentionally */
2930+
fallthrough;
29302931
case ZEND_JMPZNZ:
29312932
case ZEND_JMPZ_EX:
29322933
case ZEND_JMPNZ_EX:
@@ -3322,7 +3323,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
33223323
}
33233324
goto done;
33243325
}
3325-
/* break missing intentionally */
3326+
fallthrough;
33263327
case ZEND_JMPZ_EX:
33273328
case ZEND_JMPNZ_EX:
33283329
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:
@@ -4085,7 +4085,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
40854085
if (opline->extended_value != op1_type) {
40864086
break;
40874087
}
4088-
/* break missing intentionally */
4088+
fallthrough;
40894089
case ZEND_QM_ASSIGN:
40904090
op1_addr = OP1_REG_ADDR();
40914091
if (ra
@@ -4424,7 +4424,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
44244424
/* smart branch */
44254425
break;
44264426
}
4427-
/* break missing intentionally */
4427+
fallthrough;
44284428
case ZEND_JMPZNZ:
44294429
case ZEND_JMPZ_EX:
44304430
case ZEND_JMPNZ_EX:
@@ -4569,7 +4569,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
45694569
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) {
45704570
break;
45714571
}
4572-
/* break missing intentionally */
4572+
fallthrough;
45734573
case ZEND_FETCH_DIM_R:
45744574
case ZEND_FETCH_DIM_IS:
45754575
case ZEND_FETCH_LIST_R:
@@ -4767,7 +4767,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
47674767
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) {
47684768
break;
47694769
}
4770-
/* break missing intentionally */
4770+
fallthrough;
47714771
case ZEND_FETCH_OBJ_R:
47724772
case ZEND_FETCH_OBJ_IS:
47734773
case ZEND_FETCH_OBJ_W:

0 commit comments

Comments
 (0)