1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add missing hooks JIT restart code

Closes GH-19207.
This commit is contained in:
Niels Dossche
2025-07-21 22:48:15 +02:00
parent b82c8ba7fe
commit 9ce51dad8b
2 changed files with 19 additions and 0 deletions

1
NEWS
View File

@@ -46,6 +46,7 @@ PHP NEWS
- Opcache:
. Reset global pointers to prevent use-after-free in zend_jit_status().
(Florian Engelhardt)
. Fix issue with JIT restart and hooks. (nielsdos)
- OpenSSL:
. Fixed bug GH-18986 (OpenSSL backend: incorrect RAND_{load,write}_file()

View File

@@ -3836,6 +3836,24 @@ static void zend_jit_restart_preloaded_script(zend_persistent_script *script)
zend_jit_restart_preloaded_op_array(op_array);
}
} ZEND_HASH_FOREACH_END();
if (ce->num_hooked_props > 0) {
zend_property_info *prop;
ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop) {
if (prop->hooks) {
for (uint32_t i = 0; i < ZEND_PROPERTY_HOOK_COUNT; i++) {
if (prop->hooks[i]) {
op_array = &prop->hooks[i]->op_array;
ZEND_ASSERT(op_array->type == ZEND_USER_FUNCTION);
if (!(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)) {
zend_jit_restart_preloaded_op_array(op_array);
}
}
}
}
} ZEND_HASH_FOREACH_END();
}
} ZEND_HASH_FOREACH_END();
}