Skip to content

Commit bf486ba

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in JIT
1 parent adf4c2b commit bf486ba

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
@@ -678,6 +678,7 @@ static int zend_may_overflow(const zend_op *opline, const zend_ssa_op *ssa_op, c
678678
ssa->var_info[res].range.underflow ||
679679
ssa->var_info[res].range.overflow);
680680
}
681+
fallthrough;
681682
default:
682683
return 1;
683684
}
@@ -2800,7 +2801,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
28002801
goto done;
28012802
case ZEND_DO_UCALL:
28022803
is_terminated = 1;
2803-
/* break missing intentionally */
2804+
fallthrough;
28042805
case ZEND_DO_ICALL:
28052806
case ZEND_DO_FCALL_BY_NAME:
28062807
case ZEND_DO_FCALL:
@@ -2989,7 +2990,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
29892990
}
29902991
goto done;
29912992
}
2992-
/* break missing intentionally */
2993+
fallthrough;
29932994
case ZEND_JMPZNZ:
29942995
case ZEND_JMPZ_EX:
29952996
case ZEND_JMPNZ_EX:
@@ -3385,7 +3386,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
33853386
}
33863387
goto done;
33873388
}
3388-
/* break missing intentionally */
3389+
fallthrough;
33893390
case ZEND_JMPZ_EX:
33903391
case ZEND_JMPNZ_EX:
33913392
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
@@ -418,7 +418,7 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_r_helper(zend_array *ht, zval *dim,
418418
goto str_index;
419419
case IS_UNDEF:
420420
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
421-
/* break missing intentionally */
421+
fallthrough;
422422
case IS_NULL:
423423
offset_key = ZSTR_EMPTY_ALLOC();
424424
goto str_index;
@@ -483,7 +483,7 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_is_helper(zend_array *ht, zval *dim
483483
goto str_index;
484484
case IS_UNDEF:
485485
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
486-
/* break missing intentionally */
486+
fallthrough;
487487
case IS_NULL:
488488
offset_key = ZSTR_EMPTY_ALLOC();
489489
goto str_index;
@@ -546,7 +546,7 @@ static int ZEND_FASTCALL zend_jit_fetch_dim_isset_helper(zend_array *ht, zval *d
546546
goto str_index;
547547
case IS_UNDEF:
548548
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
549-
/* break missing intentionally */
549+
fallthrough;
550550
case IS_NULL:
551551
offset_key = ZSTR_EMPTY_ALLOC();
552552
goto str_index;
@@ -613,7 +613,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
613613
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
614614
return NULL;
615615
}
616-
/* break missing intentionally */
616+
fallthrough;
617617
case IS_NULL:
618618
offset_key = ZSTR_EMPTY_ALLOC();
619619
goto str_index;
@@ -686,7 +686,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
686686
if (!zend_jit_undefined_op_helper_write(ht, EG(current_execute_data)->opline->op2.var)) {
687687
return NULL;
688688
}
689-
/* break missing intentionally */
689+
fallthrough;
690690
case IS_NULL:
691691
offset_key = ZSTR_EMPTY_ALLOC();
692692
goto str_index;
@@ -753,6 +753,7 @@ static zend_never_inline zend_long zend_check_string_offset(zval *dim/*, int typ
753753
}
754754
case IS_UNDEF:
755755
zend_jit_undefined_op_helper(EG(current_execute_data)->opline->op2.var);
756+
fallthrough;
756757
case IS_DOUBLE:
757758
case IS_NULL:
758759
case IS_FALSE:

ext/opcache/jit/zend_jit_trace.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15171517
if (opline->result_type != IS_UNUSED) {
15181518
break;
15191519
}
1520-
/* break missing intentionally */
1520+
fallthrough;
15211521
case ZEND_ASSIGN_DIM:
15221522
if (opline->op1_type == IS_CV) {
15231523
ADD_OP1_DATA_TRACE_GUARD();
@@ -1541,7 +1541,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15411541
if (opline->result_type != IS_UNUSED) {
15421542
break;
15431543
}
1544-
/* break missing intentionally */
1544+
fallthrough;
15451545
case ZEND_ASSIGN_OBJ:
15461546
case ZEND_PRE_INC_OBJ:
15471547
case ZEND_PRE_DEC_OBJ:
@@ -1578,7 +1578,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15781578
case ZEND_CONCAT:
15791579
case ZEND_FAST_CONCAT:
15801580
ADD_OP2_TRACE_GUARD();
1581-
/* break missing intentionally */
1581+
fallthrough;
15821582
case ZEND_ECHO:
15831583
case ZEND_STRLEN:
15841584
case ZEND_QM_ASSIGN:
@@ -1644,7 +1644,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
16441644
/* smart branch */
16451645
break;
16461646
}
1647-
/* break missing intentionally */
1647+
fallthrough;
16481648
case ZEND_JMPZNZ:
16491649
case ZEND_JMPZ_EX:
16501650
case ZEND_JMPNZ_EX:
@@ -1670,7 +1670,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
16701670
// TODO: support for empty() ???
16711671
break;
16721672
}
1673-
/* break missing intentionally */
1673+
fallthrough;
16741674
case ZEND_FETCH_DIM_R:
16751675
case ZEND_FETCH_DIM_IS:
16761676
case ZEND_FETCH_LIST_R:
@@ -1721,7 +1721,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
17211721
if (opline->op2.num > MAX_ARG_FLAG_NUM) {
17221722
goto propagate_arg;
17231723
}
1724-
/* break missing intentionally */
1724+
fallthrough;
17251725
case ZEND_SEND_VAL:
17261726
case ZEND_SEND_VAR:
17271727
case ZEND_SEND_VAR_NO_REF:
@@ -1814,7 +1814,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
18141814
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(frame->call)) {
18151815
break;
18161816
}
1817-
/* break missing intentionally */
1817+
fallthrough;
18181818
case ZEND_FETCH_OBJ_R:
18191819
case ZEND_FETCH_OBJ_IS:
18201820
case ZEND_FETCH_OBJ_W:
@@ -4597,7 +4597,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
45974597
if (opline->extended_value != op1_type) {
45984598
break;
45994599
}
4600-
/* break missing intentionally */
4600+
fallthrough;
46014601
case ZEND_QM_ASSIGN:
46024602
op1_addr = OP1_REG_ADDR();
46034603
if (ra
@@ -4992,7 +4992,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
49924992
/* smart branch */
49934993
break;
49944994
}
4995-
/* break missing intentionally */
4995+
fallthrough;
49964996
case ZEND_JMPZNZ:
49974997
case ZEND_JMPZ_EX:
49984998
case ZEND_JMPNZ_EX:
@@ -5137,7 +5137,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
51375137
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) {
51385138
break;
51395139
}
5140-
/* break missing intentionally */
5140+
fallthrough;
51415141
case ZEND_FETCH_DIM_R:
51425142
case ZEND_FETCH_DIM_IS:
51435143
case ZEND_FETCH_LIST_R:
@@ -5335,7 +5335,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
53355335
|| !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) {
53365336
break;
53375337
}
5338-
/* break missing intentionally */
5338+
fallthrough;
53395339
case ZEND_FETCH_OBJ_R:
53405340
case ZEND_FETCH_OBJ_IS:
53415341
case ZEND_FETCH_OBJ_W:

0 commit comments

Comments
 (0)