Skip to content

Commit

Permalink
Add Check The Function Existence At Execution Time For ZEND_INIT_FCAL…
Browse files Browse the repository at this point in the history
…L Opcode

See The #16138 (comment)
  • Loading branch information
tahaghafuri committed Sep 30, 2024
1 parent 494aa65 commit ba137c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Zend/zend_vm_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -4003,6 +4003,9 @@ ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT)
func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname));
ZEND_ASSERT(func != NULL && "Function existence must be checked at compile time");
fbc = Z_FUNC_P(func);
if(UNEXPECTED(fbc == NULL)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
}
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
init_func_run_time_cache(&fbc->op_array);
}
Expand Down

0 comments on commit ba137c6

Please sign in to comment.