Skip to content

Commit 7ab12bf

Browse files
committed
Do internal interrupts while frame is on top
1 parent be12189 commit 7ab12bf

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

Zend/zend_vm_def.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4075,6 +4075,14 @@ ZEND_VM_HOT_HANDLER(129, ZEND_DO_ICALL, ANY, ANY, SPEC(RETVAL,OBSERVER))
40754075
#endif
40764076
ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret);
40774077

4078+
if (UNEXPECTED(zend_atomic_bool_load_ex(&EG(vm_interrupt)))) {
4079+
if (zend_atomic_bool_load_ex(&EG(timed_out))) {
4080+
zend_timeout();
4081+
} else if (zend_interrupt_function) {
4082+
zend_interrupt_function(execute_data);
4083+
}
4084+
}
4085+
40784086
EG(current_execute_data) = execute_data;
40794087
zend_vm_stack_free_args(call);
40804088

@@ -4197,6 +4205,14 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL,OBSERVER))
41974205
#endif
41984206
ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret);
41994207

4208+
if (UNEXPECTED(zend_atomic_bool_load_ex(&EG(vm_interrupt)))) {
4209+
if (zend_atomic_bool_load_ex(&EG(timed_out))) {
4210+
zend_timeout();
4211+
} else if (zend_interrupt_function) {
4212+
zend_interrupt_function(execute_data);
4213+
}
4214+
}
4215+
42004216
EG(current_execute_data) = execute_data;
42014217

42024218
ZEND_VM_C_GOTO(fcall_by_name_end);
@@ -4318,6 +4334,14 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER))
43184334
#endif
43194335
ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret);
43204336

4337+
if (UNEXPECTED(zend_atomic_bool_load_ex(&EG(vm_interrupt)))) {
4338+
if (zend_atomic_bool_load_ex(&EG(timed_out))) {
4339+
zend_timeout();
4340+
} else if (zend_interrupt_function) {
4341+
zend_interrupt_function(execute_data);
4342+
}
4343+
}
4344+
43214345
EG(current_execute_data) = execute_data;
43224346

43234347
ZEND_VM_C_GOTO(fcall_end);

Zend/zend_vm_execute.h

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)