Skip to content

Commit 606eb84

Browse files
committed
Stop recording of trace when encountering hook
Fixes GH-15178
1 parent b839c5f commit 606eb84

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ PHP NEWS
3737
- Opcache:
3838
. Fixed bug GH-15490 (Building of callgraph modifies preloaded symbols).
3939
(ilutov)
40+
. Fixed bug GH-15178 (Assertion in tracing JIT on hooks). (ilutov)
4041

4142
- PDO_MYSQL:
4243
. mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT. (Appla)

ext/opcache/jit/zend_jit_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ zend_constant* ZEND_FASTCALL zend_jit_check_constant(const zval *key);
265265
_(INNER_LOOP, "inner loop") /* trace it */ \
266266
_(COMPILED_LOOP, "compiled loop") \
267267
_(TRAMPOLINE, "trampoline call") \
268+
_(PROP_HOOK_CALL, "property hook call") \
268269
_(BAD_FUNC, "bad function call") \
269270
_(COMPILER_ERROR, "JIT compilation error") \
270271
/* no recoverable error (blacklist immediately) */ \

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,11 @@ static int zend_jit_trace_record_fake_init_call_ex(zend_execute_data *call, zend
503503
/* TODO: Can we continue recording ??? */
504504
return -1;
505505
}
506+
/* Function is a property hook. */
507+
if (func->common.prop_info) {
508+
/* TODO: Can we continue recording ??? */
509+
return -1;
510+
}
506511
if (func->type == ZEND_INTERNAL_FUNCTION
507512
&& (func->op_array.fn_flags & (ZEND_ACC_CLOSURE|ZEND_ACC_FAKE_CLOSURE))) {
508513
return -1;
@@ -966,6 +971,12 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
966971
break;
967972
}
968973

974+
if (EX(func)->op_array.prop_info) {
975+
/* TODO: Can we continue recording ??? */
976+
stop = ZEND_JIT_TRACE_STOP_PROP_HOOK_CALL;
977+
break;
978+
}
979+
969980
TRACE_RECORD(ZEND_JIT_TRACE_ENTER,
970981
EX(return_value) != NULL ? ZEND_JIT_TRACE_RETURN_VALUE_USED : 0,
971982
op_array);
@@ -1069,6 +1080,10 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
10691080
/* TODO: Can we continue recording ??? */
10701081
stop = ZEND_JIT_TRACE_STOP_BAD_FUNC;
10711082
break;
1083+
} else if (EX(call)->func->common.prop_info) {
1084+
/* TODO: Can we continue recording ??? */
1085+
stop = ZEND_JIT_TRACE_STOP_PROP_HOOK_CALL;
1086+
break;
10721087
}
10731088
func = EX(call)->func;
10741089
if (func->type == ZEND_INTERNAL_FUNCTION

0 commit comments

Comments
 (0)