Skip to content

Commit 39e2a14

Browse files
committed
ZEND_INIT_FCALL is only produced when function exists at compile time
1 parent 09e991f commit 39e2a14

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
@@ -3913,9 +3913,7 @@ ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT)
39133913
if (UNEXPECTED(fbc == NULL)) {
39143914
fname = (zval*)RT_CONSTANT(opline, opline->op2);
39153915
func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname));
3916-
if (UNEXPECTED(func == NULL)) {
3917-
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
3918-
}
3916+
ZEND_ASSERT(func != NULL && "Function existence must be checked at compile time");
39193917
fbc = Z_FUNC_P(func);
39203918
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
39213919
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
@@ -3672,9 +3672,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CO
36723672
if (UNEXPECTED(fbc == NULL)) {
36733673
fname = (zval*)RT_CONSTANT(opline, opline->op2);
36743674
func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname));
3675-
if (UNEXPECTED(func == NULL)) {
3676-
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
3677-
}
3675+
ZEND_ASSERT(func != NULL && "Function existence must be checked at compile time");
36783676
fbc = Z_FUNC_P(func);
36793677
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
36803678
init_func_run_time_cache(&fbc->op_array);

0 commit comments

Comments
 (0)