From 45dac39c719f140ae4deebcee4f99de5a2aabd68 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 29 Aug 2024 16:54:25 +0300 Subject: [PATCH] Prevent JIT of propery hooks in case of file caching (related to GH-15497) --- ext/opcache/zend_persist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 6f1cc16ba01..555806ea352 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -815,7 +815,10 @@ static zend_property_info *zend_persist_property_info(zend_property_info *prop) if (prop->hooks[i]) { zend_op_array *hook = zend_persist_class_method(&prop->hooks[i]->op_array, ce); #ifdef HAVE_JIT - if (JIT_G(on) && JIT_G(opt_level) <= ZEND_JIT_LEVEL_OPT_FUNCS) { + if (JIT_G(on) + && JIT_G(opt_level) <= ZEND_JIT_LEVEL_OPT_FUNCS + && (!ZCG(current_persistent_script) + || !ZCG(current_persistent_script)->corrupted)) { if (hook->scope == ce && !(hook->fn_flags & ZEND_ACC_TRAIT_CLONE)) { zend_jit_op_array(hook, ZCG(current_persistent_script) ? &ZCG(current_persistent_script)->script : NULL); }