Skip to content

Commit 696ac99

Browse files
committed
Function decl may be elided by opcache
1 parent b5df1b4 commit 696ac99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/opcache/modules.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,11 +948,14 @@ static zend_result zum_check_deps(zend_user_module *module,
948948
}
949949
} ZEND_HASH_FOREACH_END();
950950
zend_function *function;
951-
ZEND_HASH_MAP_FOREACH_PTR(&persistent_script->script.function_table, function) {
951+
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&persistent_script->script.function_table, key, function) {
952952
if (UNEXPECTED(zum_check_deps_op_array(module, &function->op_array) == FAILURE)) {
953953
ZEND_ASSERT(EG(exception));
954954
goto failure;
955955
}
956+
957+
ZEND_ASSERT(function->type == ZEND_USER_FUNCTION);
958+
zend_hash_add_ptr(&module->function_table, key, function);
956959
} ZEND_HASH_FOREACH_END();
957960
} ZEND_HASH_FOREACH_END();
958961

0 commit comments

Comments
 (0)