Skip to content

Commit 5468218

Browse files
committed
update more fcall opcodes
1 parent 0fc8a1a commit 5468218

File tree

2 files changed

+88
-8
lines changed

2 files changed

+88
-8
lines changed

Zend/zend_vm_def.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4146,6 +4146,14 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL,OBSERVER))
41464146
#endif
41474147
ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret);
41484148

4149+
if (UNEXPECTED(zend_atomic_bool_load_ex(&EG(vm_interrupt)))) {
4150+
if (zend_atomic_bool_load_ex(&EG(timed_out))) {
4151+
zend_timeout();
4152+
} else if (zend_interrupt_function) {
4153+
zend_interrupt_function(execute_data);
4154+
}
4155+
}
4156+
41494157
EG(current_execute_data) = execute_data;
41504158

41514159
ZEND_VM_C_LABEL(fcall_by_name_end):
@@ -4170,7 +4178,9 @@ ZEND_VM_C_LABEL(fcall_by_name_end):
41704178
zend_rethrow_exception(execute_data);
41714179
HANDLE_EXCEPTION();
41724180
}
4173-
ZEND_VM_SET_OPCODE(opline + 1);
4181+
// todo: under what circumstances do ZEND_USER_FUNCTIONs take this code path?
4182+
CHECK_SYMBOL_TABLES()
4183+
OPLINE = opline + 1;
41744184
ZEND_VM_CONTINUE();
41754185
}
41764186

@@ -4258,6 +4268,14 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER))
42584268
#endif
42594269
ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret);
42604270

4271+
if (UNEXPECTED(zend_atomic_bool_load_ex(&EG(vm_interrupt)))) {
4272+
if (zend_atomic_bool_load_ex(&EG(timed_out))) {
4273+
zend_timeout();
4274+
} else if (zend_interrupt_function) {
4275+
zend_interrupt_function(execute_data);
4276+
}
4277+
}
4278+
42614279
EG(current_execute_data) = execute_data;
42624280

42634281
ZEND_VM_C_LABEL(fcall_end):
@@ -4281,7 +4299,9 @@ ZEND_VM_C_LABEL(fcall_end):
42814299
HANDLE_EXCEPTION();
42824300
}
42834301

4284-
ZEND_VM_SET_OPCODE(opline + 1);
4302+
// todo: under what circumstances do ZEND_USER_FUNCTIONs take this code path?
4303+
CHECK_SYMBOL_TABLES()
4304+
OPLINE = opline + 1;
42854305
ZEND_VM_CONTINUE();
42864306
}
42874307

Zend/zend_vm_execute.h

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

0 commit comments

Comments
 (0)