Skip to content

Commit

Permalink
Fix failing VirtualProtect() calls
Browse files Browse the repository at this point in the history
Whenever JIT is disabled due to incompatibilities, we also need to set
`JIT_G(on)` to zero.

Closes GH-6470.
  • Loading branch information
cmb69 committed Dec 2, 2020
1 parent 9dda22b commit 72cd579
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/opcache/jit/zend_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -4183,13 +4184,15 @@ 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;
}

for (i = 0; i <= 256; i++) {
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;
}
}
Expand Down

0 comments on commit 72cd579

Please sign in to comment.