]> granicus.if.org Git - php/commitdiff
Fix failing VirtualProtect() calls
authorChristoph M. Becker <cmbecker69@gmx.de>
Wed, 2 Dec 2020 14:06:30 +0000 (15:06 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Wed, 2 Dec 2020 15:51:50 +0000 (16:51 +0100)
Whenever JIT is disabled due to incompatibilities, we also need to set
`JIT_G(on)` to zero.

Closes GH-6470.

ext/opcache/jit/zend_jit.c

index bcba053d16d966c499b18e6a9708d7e579622eac..49ff973d1a77512e297c6cbcc981f7179c7f8db6 100644 (file)
@@ -4175,6 +4175,7 @@ ZEND_EXT_API int zend_jit_check_support(void)
            zend_jit_vm_kind != ZEND_VM_KIND_HYBRID) {
                zend_error(E_WARNING, "JIT is compatible only with CALL and HYBRID VM. JIT disabled.");
                JIT_G(enabled) = 0;
+               JIT_G(on) = 0;
                return FAILURE;
        }
 
@@ -4183,6 +4184,7 @@ ZEND_EXT_API int zend_jit_check_support(void)
                        zend_error(E_WARNING, "JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled.");
                }
                JIT_G(enabled) = 0;
+               JIT_G(on) = 0;
                return FAILURE;
        }
 
@@ -4190,6 +4192,7 @@ ZEND_EXT_API int zend_jit_check_support(void)
                if (zend_get_user_opcode_handler(i) != NULL) {
                        zend_error(E_WARNING, "JIT is incompatible with third party extensions that setup user opcode handlers. JIT disabled.");
                        JIT_G(enabled) = 0;
+                       JIT_G(on) = 0;
                        return FAILURE;
                }
        }