Skip to content

Commit f41bceb

Browse files
committed
Move asserts to better places
1 parent b71b696 commit f41bceb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,6 +2612,7 @@ static void zend_jit_trace_setup_ret_counter(const zend_op *opline, size_t offse
26122612
zend_op *next_opline = (zend_op*)(opline + 1);
26132613

26142614
if (JIT_G(hot_return) && !ZEND_OP_TRACE_INFO(next_opline, offset)->trace_flags) {
2615+
ZEND_ASSERT(zend_jit_ret_trace_counter_handler != NULL);
26152616
if (!ZEND_OP_TRACE_INFO(next_opline, offset)->counter) {
26162617
ZEND_OP_TRACE_INFO(next_opline, offset)->counter =
26172618
&zend_jit_hot_counters[ZEND_JIT_COUNTER_NUM];
@@ -5693,9 +5694,6 @@ static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array)
56935694
zend_jit_op_array_trace_extension *jit_extension;
56945695
uint32_t i;
56955696

5696-
ZEND_ASSERT(zend_jit_func_trace_counter_handler != NULL);
5697-
ZEND_ASSERT(zend_jit_ret_trace_counter_handler != NULL);
5698-
ZEND_ASSERT(zend_jit_loop_trace_counter_handler != NULL);
56995697
ZEND_ASSERT(sizeof(zend_op_trace_info) == sizeof(zend_op));
57005698

57015699
jit_extension = (zend_jit_op_array_trace_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_trace_extension) + (op_array->last - 1) * sizeof(zend_op_trace_info));
@@ -5716,6 +5714,8 @@ static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array)
57165714
if (JIT_G(hot_loop)) {
57175715
zend_cfg cfg;
57185716

5717+
ZEND_ASSERT(zend_jit_loop_trace_counter_handler != NULL);
5718+
57195719
if (zend_jit_build_cfg(op_array, &cfg) != SUCCESS) {
57205720
return FAILURE;
57215721
}
@@ -5741,6 +5741,7 @@ static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array)
57415741
}
57425742

57435743
if (JIT_G(hot_func)) {
5744+
ZEND_ASSERT(zend_jit_func_trace_counter_handler != NULL);
57445745
opline = op_array->opcodes;
57455746
if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
57465747
while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {

0 commit comments

Comments
 (0)