Skip to content

Commit 55585b0

Browse files
committed
ZEND_INIT_FCALL is only produced when function exists at compile time
1 parent 9c6b843 commit 55585b0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Zend/zend_vm_def.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,9 +3930,7 @@ ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT)
39303930
if (UNEXPECTED(fbc == NULL)) {
39313931
fname = (zval*)RT_CONSTANT(opline, opline->op2);
39323932
func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname));
3933-
if (UNEXPECTED(func == NULL)) {
3934-
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
3935-
}
3933+
ZEND_ASSERT(func != NULL && "Function existence must be checked at compile time");
39363934
fbc = Z_FUNC_P(func);
39373935
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
39383936
init_func_run_time_cache(&fbc->op_array);

Zend/zend_vm_execute.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3693,9 +3693,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CO
36933693
if (UNEXPECTED(fbc == NULL)) {
36943694
fname = (zval*)RT_CONSTANT(opline, opline->op2);
36953695
func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname));
3696-
if (UNEXPECTED(func == NULL)) {
3697-
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
3698-
}
3696+
ZEND_ASSERT(func != NULL && "Function existence must be checked at compile time");
36993697
fbc = Z_FUNC_P(func);
37003698
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
37013699
init_func_run_time_cache(&fbc->op_array);

0 commit comments

Comments
 (0)