diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-16 16:29:05 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-16 18:39:09 +0200 |
commit | 92c4b0651368a4135f692af48f4716c96de4bd92 (patch) | |
tree | 052276ba1af9bcf5fd113f9bf8d6d93075d69aa3 /ext | |
parent | 9ff3230c20f27ac35788aca72f16ff928a25f81b (diff) | |
download | php-git-92c4b0651368a4135f692af48f4716c96de4bd92.tar.gz |
Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)
Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds. This may be useful for other compilers as well.
[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/ffi/ffi.c | 12 | ||||
-rw-r--r-- | ext/gd/gd.c | 4 | ||||
-rw-r--r-- | ext/opcache/Optimizer/optimize_func_calls.c | 2 | ||||
-rw-r--r-- | ext/opcache/Optimizer/sccp.c | 2 | ||||
-rw-r--r-- | ext/opcache/Optimizer/scdf.h | 2 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_inference.c | 2 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_optimizer.c | 2 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_ssa.c | 4 | ||||
-rw-r--r-- | ext/opcache/jit/zend_jit.c | 4 | ||||
-rw-r--r-- | ext/opcache/jit/zend_jit_internal.h | 6 | ||||
-rw-r--r-- | ext/opcache/jit/zend_jit_trace.c | 20 | ||||
-rw-r--r-- | ext/opcache/jit/zend_jit_x86.dasc | 136 | ||||
-rw-r--r-- | ext/session/session.c | 2 | ||||
-rw-r--r-- | ext/spl/spl_directory.c | 2 | ||||
-rw-r--r-- | ext/spl/spl_heap.c | 2 |
15 files changed, 101 insertions, 101 deletions
diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 4de14fe738..28baf1fd31 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -1504,7 +1504,7 @@ static int zend_ffi_ctype_name(zend_ffi_ctype_name_buf *buf, const zend_ffi_type } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if (name) { break; @@ -1992,7 +1992,7 @@ static HashTable *zend_ffi_cdata_get_debug_info(zend_object *obj, int *is_temp) return ht; break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); break; } return NULL; @@ -5364,7 +5364,7 @@ void zend_ffi_resolve_const(const char *name, size_t name_len, zend_ffi_val *val val->kind = ZEND_FFI_VAL_UINT64; break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } return; } @@ -6185,7 +6185,7 @@ void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, return; } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); return; } dcl->type = type; @@ -6212,7 +6212,7 @@ void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, type = ZEND_FFI_TYPE(dcl->type); type->enumeration.tag_name = zend_string_copy(tag_name); } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } tag->type = ZEND_FFI_TYPE_MAKE_OWNED(dcl->type); dcl->type = ZEND_FFI_TYPE(dcl->type); @@ -6511,7 +6511,7 @@ static int zend_ffi_nested_type(zend_ffi_type *type, zend_ffi_type *nested_type) } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } /* }}} */ diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 4089e40691..d915398c7b 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1872,7 +1872,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char (*func_p)(im, fp, q, t); break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } fflush(fp); fclose(fp); @@ -1899,7 +1899,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char (*func_p)(im, tmp, q, t); break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } fseek(tmp, 0, SEEK_SET); diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c index 309a140167..84520f8f9c 100644 --- a/ext/opcache/Optimizer/optimize_func_calls.c +++ b/ext/opcache/Optimizer/optimize_func_calls.c @@ -214,7 +214,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) || fcall->opcode == ZEND_NEW) { /* We don't have specialized opcodes for this, do nothing */ } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if ((ZEND_OPTIMIZER_PASS_16 & ctx->optimization_level) diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c index ac363eaddc..c51b5c3ee2 100644 --- a/ext/opcache/Optimizer/sccp.c +++ b/ext/opcache/Optimizer/sccp.c @@ -267,7 +267,7 @@ static zend_bool can_replace_op1( (opline - 1)->opcode != ZEND_ASSIGN_STATIC_PROP_REF; default: if (ssa_op->op1_def != -1) { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); return 0; } } diff --git a/ext/opcache/Optimizer/scdf.h b/ext/opcache/Optimizer/scdf.h index 1b730936ec..64b4b61340 100644 --- a/ext/opcache/Optimizer/scdf.h +++ b/ext/opcache/Optimizer/scdf.h @@ -86,7 +86,7 @@ static inline uint32_t scdf_edge(zend_cfg *cfg, int from, int to) { return edge; } } - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } static inline zend_bool scdf_is_edge_feasible(scdf_ctx *scdf, int from, int to) { diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index a56464e75f..0c0a2921c9 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -3510,7 +3510,7 @@ static zend_always_inline int _zend_update_type_info( case ZEND_CATCH: case ZEND_INCLUDE_OR_EVAL: /* Forbidden opcodes */ - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); break; default: unknown_opcode: diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index 2e75ae1fd3..8456c46078 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -615,7 +615,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array, ZEND_ASSERT(opline->extended_value == ZEND_FREE_ON_RETURN); MAKE_NOP(opline); } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } opline++; diff --git a/ext/opcache/Optimizer/zend_ssa.c b/ext/opcache/Optimizer/zend_ssa.c index 63e151c76e..8c2d858e96 100644 --- a/ext/opcache/Optimizer/zend_ssa.c +++ b/ext/opcache/Optimizer/zend_ssa.c @@ -1189,7 +1189,7 @@ int zend_ssa_unlink_use_chain(zend_ssa *ssa, int op, int var) /* {{{ */ } } /* something wrong */ - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); return 0; } } @@ -1238,7 +1238,7 @@ static inline zend_ssa_phi **zend_ssa_next_use_phi_ptr(zend_ssa *ssa, int var, z } } } - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); return NULL; } /* }}} */ diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 31e421424a..3f37a07b3e 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -3373,7 +3373,7 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script) return SUCCESS; } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } @@ -3485,7 +3485,7 @@ ZEND_EXT_API int zend_jit_script(zend_script *script) ZEND_SET_FUNC_INFO(call_graph.op_arrays[i], NULL); } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } zend_arena_release(&CG(arena), checkpoint); diff --git a/ext/opcache/jit/zend_jit_internal.h b/ext/opcache/jit/zend_jit_internal.h index 1624bd816d..ab3a7a8e4a 100644 --- a/ext/opcache/jit/zend_jit_internal.h +++ b/ext/opcache/jit/zend_jit_internal.h @@ -451,10 +451,10 @@ static zend_always_inline const zend_op* zend_jit_trace_get_exit_opline(zend_jit *exit_if_true = opline->opcode == ZEND_JMPZ; return opline + 1; } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } *exit_if_true = 0; return NULL; @@ -476,7 +476,7 @@ static zend_always_inline zend_bool zend_jit_may_be_polymorphic_call(const zend_ } else if (opline->opcode == ZEND_NEW) { return (opline->op1_type != IS_CONST); } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); return 0; } } diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index a8d42cddfe..a39486a289 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -41,7 +41,7 @@ static zend_always_inline const char *zend_jit_trace_star_desc(uint8_t trace_fla } else if (trace_flags & ZEND_JIT_TRACE_START_RETURN) { return "return"; } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); return "???"; } } @@ -212,7 +212,7 @@ static uint32_t zend_jit_find_trace(const void *addr) return i; } } - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); return 0; } @@ -2711,7 +2711,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par } else if (i < parent_vars_count && STACK_TYPE(parent_stack, i) != IS_UNKNOWN) { /* This must be already handled by trace type inference */ - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); SET_STACK_TYPE(stack, i, STACK_TYPE(parent_stack, i)); } else if ((info & MAY_BE_GUARD) != 0 && trace_buffer->stop == ZEND_JIT_TRACE_STOP_LOOP @@ -2729,7 +2729,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par && op_array->function_name && i >= op_array->num_args) { /* This must be already handled by trace type inference */ - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); SET_STACK_TYPE(stack, i, IS_UNDEF); } else { SET_STACK_TYPE(stack, i, IS_UNKNOWN); @@ -3574,7 +3574,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par smart_branch_opcode = opline->opcode; exit_opline = OP_JMP_ADDR(opline, opline->op2); } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if (ra) { zend_jit_trace_clenup_stack(stack, opline, ssa_op, ssa, ra); @@ -3585,7 +3585,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par goto jit_failure; } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if (opline->result_type == IS_UNDEF) { res_addr = 0; @@ -4234,7 +4234,7 @@ done: frame->call = call->prev; } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } @@ -5278,7 +5278,7 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf } else if (STACK_REG(stack, i) == ZREG_LONG_MAX) { val = ZEND_LONG_MAX; } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } ZVAL_LONG(EX_VAR_NUM(i), val); } else if (STACK_TYPE(stack, i) == IS_DOUBLE) { @@ -5291,11 +5291,11 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf } else if (STACK_REG(stack, i) == ZREG_LONG_MAX_PLUS_1) { val = (double)ZEND_LONG_MAX + 1.0; } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } ZVAL_DOUBLE(EX_VAR_NUM(i), val); } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } } diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 20ec35fa7e..3ce04d051b 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -454,7 +454,7 @@ static void* dasm_labels[zend_lb_MAX]; || } else if (Z_MODE(addr) == IS_MEM_ZVAL) { | LOAD_BASE_ADDR reg, Z_REG(addr), Z_OFFSET(addr) || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -464,7 +464,7 @@ static void* dasm_labels[zend_lb_MAX]; || } else if (Z_MODE(addr) == IS_MEM_ZVAL) { | PUSH_BASE_ADDR Z_REG(addr), Z_OFFSET(addr), tmp_reg || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -548,7 +548,7 @@ static void* dasm_labels[zend_lb_MAX]; || } else if (Z_MODE(addr) == IS_REG) { | sse_ins xmm(reg-ZREG_XMM0), xmm(Z_REG(addr)-ZREG_XMM0) || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -569,7 +569,7 @@ static void* dasm_labels[zend_lb_MAX]; || } else if (Z_MODE(addr) == IS_REG) { | SSE_AVX_INS sse_ins, avx_ins, xmm(reg-ZREG_XMM0), xmm(Z_REG(addr)-ZREG_XMM0) || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -614,7 +614,7 @@ static void* dasm_labels[zend_lb_MAX]; | cvtsi2sd xmm(reg-ZREG_XMM0), Ra(Z_REG(addr)) || } || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -636,7 +636,7 @@ static void* dasm_labels[zend_lb_MAX]; || } else if (Z_MODE(addr) == IS_REG) { | SSE_AVX_INS movsd, vmovaps, xmm(reg-ZREG_XMM0), xmm(Z_REG(addr)-ZREG_XMM0) || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } || } |.endmacro @@ -694,7 +694,7 @@ static void* dasm_labels[zend_lb_MAX]; || } else if (Z_MODE(addr) == IS_REG) { | avx_ins xmm(reg-ZREG_XMM0), xmm(op1_reg-ZREG_XMM0), xmm(Z_REG(addr)-ZREG_XMM0) || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -754,7 +754,7 @@ static void* dasm_labels[zend_lb_MAX]; || } else if (Z_MODE(addr) == IS_REG) { | long_ins Ra(reg), Ra(Z_REG(addr)) || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -782,7 +782,7 @@ static void* dasm_labels[zend_lb_MAX]; | long_ins Ra(Z_REG(op1_addr)), lval | .endif || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -808,7 +808,7 @@ static void* dasm_labels[zend_lb_MAX]; | mov Ra(reg), Ra(Z_REG(addr)) || } || } else { -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -833,7 +833,7 @@ static void* dasm_labels[zend_lb_MAX]; | LONG_OP xor, reg, addr || break; || default: -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -858,7 +858,7 @@ static void* dasm_labels[zend_lb_MAX]; | xor dst_reg, src_reg || break; || default: -|| ZEND_ASSERT(0); +|| ZEND_UNREACHABLE(); || } |.endmacro @@ -2546,7 +2546,7 @@ static int zend_jit_context_threaded_call_stub(dasm_State **Dst) | add r4, SPAD // stack alignment | jmp aword [IP] } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); // TODO: context threading can't work without GLOBAL REGS because we have to change // the value of execute_data in execute_ex() | mov FCARG1a, FP @@ -3411,7 +3411,7 @@ static int zend_jit_spill_store(dasm_State **Dst, zend_jit_addr src, zend_jit_ad | SET_ZVAL_TYPE_INFO dst, IS_DOUBLE } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } return 1; } @@ -3426,7 +3426,7 @@ static int zend_jit_load_reg(dasm_State **Dst, zend_jit_addr src, zend_jit_addr } else if ((info & MAY_BE_ANY) == MAY_BE_DOUBLE) { | SSE_GET_ZVAL_DVAL Z_REG(dst), src } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } return 1; } @@ -3483,7 +3483,7 @@ static int zend_jit_update_regs(dasm_State **Dst, zend_jit_addr src, zend_jit_ad } else if ((info & MAY_BE_ANY) == MAY_BE_DOUBLE) { | SSE_AVX_INS movsd, vmovaps, xmm(Z_REG(dst)-ZREG_XMM0), xmm(Z_REG(src)-ZREG_XMM0) } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (Z_MODE(dst) == IS_MEM_ZVAL) { if (!Z_LOAD(src) && !Z_STORE(src)) { @@ -3492,7 +3492,7 @@ static int zend_jit_update_regs(dasm_State **Dst, zend_jit_addr src, zend_jit_ad } } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (Z_MODE(src) == IS_MEM_ZVAL) { if (Z_MODE(dst) == IS_REG) { @@ -3500,10 +3500,10 @@ static int zend_jit_update_regs(dasm_State **Dst, zend_jit_addr src, zend_jit_ad return 0; } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } return 1; @@ -3548,7 +3548,7 @@ static int zend_jit_store_const(dasm_State **Dst, int var, zend_reg reg) |.endif | SET_ZVAL_TYPE_INFO dst, IS_DOUBLE } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } return 1; } @@ -3702,7 +3702,7 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, const zend_ } else if (opline->opcode == ZEND_POST_DEC) { | EXT_CALL zend_jit_post_dec_typed_ref, r0 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } |.if not(X64) | add r4, 12 @@ -4279,7 +4279,7 @@ static int zend_jit_math_helper(dasm_State **Dst, } else if (opcode == ZEND_DIV) { | EXT_CALL div_function, r0 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } |.if not(X64) | add r4, 12 @@ -4592,7 +4592,7 @@ static int zend_jit_long_math_helper(dasm_State **Dst, } else if (opcode == ZEND_MOD) { | EXT_CALL mod_function, r0 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } |.if not(X64) | add r4, 12 @@ -4903,7 +4903,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o | jmp >9 break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } |.code break; @@ -4944,7 +4944,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if (type != BP_JIT_IS && (op2_info & MAY_BE_STRING)) { @@ -5028,7 +5028,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o | jmp >9 break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } |.code break; @@ -5048,7 +5048,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } @@ -5115,7 +5115,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o | jmp >9 break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if (op2_info & (MAY_BE_LONG|MAY_BE_STRING)) { |.code @@ -5298,7 +5298,7 @@ static int zend_jit_assign_to_variable(dasm_State **Dst, } else if (val_type == IS_CV) { | EXT_CALL zend_jit_assign_cv_to_typed_ref, r0 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | jmp >8 |.code @@ -5751,7 +5751,7 @@ static int zend_jit_assign_dim_op(dasm_State **Dst, const zend_op *opline, const } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } @@ -5865,7 +5865,7 @@ static int zend_jit_assign_op(dasm_State **Dst, const zend_op *opline, const zen result = zend_jit_concat_helper(Dst, opline, op_array, opline->op1_type, opline->op1, op1_addr, op1_info, opline->op2_type, opline->op2, op2_addr, op2_info, op1_addr, op1_def_info, may_throw); break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } |9: return result; @@ -5931,7 +5931,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_ } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | movzx eax, al | lea eax, [eax + 2] @@ -5994,7 +5994,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_ } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (smart_branch_opcode == ZEND_JMPNZ || smart_branch_opcode == ZEND_JMPNZ_EX) { @@ -6053,7 +6053,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_ } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (smart_branch_opcode == ZEND_JMPZNZ) { switch (opline->opcode) { @@ -6081,11 +6081,11 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_ } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | jmp => target_label2 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { switch (opline->opcode) { @@ -6113,7 +6113,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_ } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | movzx eax, al | add eax, 2 @@ -6193,7 +6193,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (smart_branch_opcode == ZEND_JMPNZ) { switch (opline->opcode) { @@ -6262,7 +6262,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (smart_branch_opcode == ZEND_JMPZNZ) { switch (opline->opcode) { @@ -6294,7 +6294,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | jmp => target_label2 } else if (smart_branch_opcode == ZEND_JMPZ_EX) { @@ -6340,7 +6340,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (smart_branch_opcode == ZEND_JMPNZ_EX) { switch (opline->opcode) { @@ -6391,10 +6391,10 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { switch (opline->opcode) { @@ -6446,7 +6446,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | SET_ZVAL_TYPE_INFO res_addr, eax } @@ -6514,7 +6514,7 @@ static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_a | setle al break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | movzx eax, al | lea eax, [eax + 2] @@ -6553,7 +6553,7 @@ static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_a } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (smart_branch_opcode == ZEND_JMPNZ || smart_branch_opcode == ZEND_JMPNZ_EX) { @@ -6588,7 +6588,7 @@ static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_a } break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (smart_branch_opcode == ZEND_JMPZNZ) { switch (opline->opcode) { @@ -6606,11 +6606,11 @@ static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_a | jg => target_label break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | jmp => target_label2 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { switch (opline->opcode) { @@ -6628,7 +6628,7 @@ static int zend_jit_cmp_slow(dasm_State **Dst, const zend_op *opline, zend_jit_a | setle al break; default: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | movzx eax, al | add eax, 2 @@ -6878,7 +6878,7 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, const zen not_identical_label = target_label; identical_label = target_label2; } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else if (opline->opcode == ZEND_IS_NOT_IDENTICAL) { if (smart_branch_opcode == ZEND_JMPZ) { @@ -6889,10 +6889,10 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, const zen identical_label = target_label; not_identical_label = target_label2; } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } @@ -7257,7 +7257,7 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, const z set_bool = 1; true_label = target_label; } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if (Z_MODE(op1_addr) == IS_CONST_ZVAL) { @@ -8032,7 +8032,7 @@ static int zend_jit_init_fcall_guard(dasm_State **Dst, const zend_op *opline, co return 0; } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); return 0; } @@ -8157,7 +8157,7 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t | LOAD_ADDR FCARG1a, zv; | EXT_CALL zend_jit_find_ns_func_helper, r0 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } | // CACHE_PTR(opline->result.num, fbc); | mov r1, EX->run_time_cache @@ -8308,7 +8308,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend } #endif } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if (trace && !func) { @@ -8939,7 +8939,7 @@ static int zend_jit_send_ref(dasm_State **Dst, const zend_op *opline, const zend op1_info |= MAY_BE_NULL; } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } if (op1_info & (MAY_BE_UNDEF|MAY_BE_ANY|MAY_BE_REF)) { @@ -9279,7 +9279,7 @@ static int zend_jit_smart_true(dasm_State **Dst, const zend_op *opline, int jmp, } else if (smart_branch_opcode == ZEND_JMPZNZ) { | jmp =>target_label2 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var); @@ -9305,7 +9305,7 @@ static int zend_jit_smart_false(dasm_State **Dst, const zend_op *opline, int jmp } else if (smart_branch_opcode == ZEND_JMPZNZ) { | jmp =>target_label } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var); @@ -9335,7 +9335,7 @@ static int zend_jit_defined(dasm_State **Dst, const zend_op *opline, const zend_ undefined_label = target_label; defined_label = target_label2; } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } @@ -9564,7 +9564,7 @@ static int zend_jit_type_check(dasm_State **Dst, const zend_op *opline, const ze | je =>target_label | jmp =>target_label2 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var); @@ -9639,7 +9639,7 @@ static int zend_jit_type_check(dasm_State **Dst, const zend_op *opline, const ze | jne =>target_label | jmp =>target_label2 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var); @@ -9854,7 +9854,7 @@ static int zend_jit_leave_func(dasm_State **Dst, const zend_op *opline, const ze #endif } else { #ifdef CONTEXT_THREADED_JIT - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); // TODO: context threading can't work without GLOBAL REGS because we have to change // the value of execute_data in execute_ex() | mov FCARG1a, FP @@ -10355,7 +10355,7 @@ static int zend_jit_isset_isempty_dim(dasm_State **Dst, const zend_op *opline, c } else if (smart_branch_opcode == ZEND_JMPZNZ) { | jmp =>target_label2 } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { | SET_ZVAL_TYPE_INFO res_addr, IS_TRUE @@ -10386,7 +10386,7 @@ static int zend_jit_isset_isempty_dim(dasm_State **Dst, const zend_op *opline, c } else if (smart_branch_opcode == ZEND_JMPZNZ) { | jmp =>target_label } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { | SET_ZVAL_TYPE_INFO res_addr, IS_FALSE @@ -11152,7 +11152,7 @@ static int zend_jit_switch(dasm_State **Dst, const zend_op *opline, const zend_o | jmp =>b } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } else { zend_ssa_op *ssa_op = &ssa->ops[opline - op_array->opcodes]; @@ -11302,7 +11302,7 @@ static int zend_jit_switch(dasm_State **Dst, const zend_op *opline, const zend_o |.code } } else { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } } return 1; diff --git a/ext/session/session.c b/ext/session/session.c index 69d2e3df3c..483bf4dd0f 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -283,7 +283,7 @@ static void bin_to_readable(unsigned char *in, size_t inlen, char *out, size_t o have += 8; } else { /* Should never happen. Input must be large enough. */ - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); break; } } diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 0ab47396a0..df33ae6548 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -376,7 +376,7 @@ static zend_object *spl_filesystem_object_clone(zend_object *old_object) intern->u.dir.index = index; break; case SPL_FS_FILE: - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } intern->file_class = source->file_class; diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index 42484a753b..4a37ef61d8 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -160,7 +160,7 @@ static void spl_pqueue_extract_helper(zval *result, spl_pqueue_elem *elem, int f return; } - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } /* }}} */ |