]> granicus.if.org Git - php/commitdiff
Fixed crash if jit.trigger is counter based with preload scripts
authorXinchen Hui <laruence@gmail.com>
Wed, 13 May 2020 10:22:29 +0000 (18:22 +0800)
committerXinchen Hui <laruence@gmail.com>
Wed, 13 May 2020 10:22:29 +0000 (18:22 +0800)
ext/opcache/zend_persist.c

index 6a158e73f9e330215aebe91ad2d94d8e8c9ec6c5..4b019eb3b3c173a579727e2aadba028ea86b38f3 100644 (file)
@@ -1144,7 +1144,9 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
 
 #ifdef HAVE_JIT
        if (ZCG(jit_enabled) && for_shm) {
-               if (ZEND_JIT_LEVEL(ZCG(accel_directives).jit) >= ZEND_JIT_LEVEL_OPT_SCRIPT) {
+               if (ZEND_JIT_LEVEL(ZCG(accel_directives).jit) >= ZEND_JIT_LEVEL_OPT_SCRIPT &&
+                               (ZEND_JIT_TRIGGER(ZCG(accel_directives).jit) == ZEND_JIT_ON_SCRIPT_LOAD ||
+                                ZEND_JIT_TRIGGER(ZCG(accel_directives).jit) == ZEND_JIT_ON_DOC_COMMENT)) {
                        zend_jit_script(&script->script);
                }
                zend_jit_protect();