Skip to content

Commit d4a206b

Browse files
committed
Backport "ignore some opcodes in the JIT check"
This is a backport of fc64a7b to the PHP-8.0 branch so that extensions don’t have to bypass the JIT check in a hacky way.
1 parent d918c14 commit d4a206b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4228,11 +4228,19 @@ ZEND_EXT_API int zend_jit_check_support(void)
42284228
}
42294229

42304230
for (i = 0; i <= 256; i++) {
4231-
if (zend_get_user_opcode_handler(i) != NULL) {
4232-
zend_error(E_WARNING, "JIT is incompatible with third party extensions that setup user opcode handlers. JIT disabled.");
4233-
JIT_G(enabled) = 0;
4234-
JIT_G(on) = 0;
4235-
return FAILURE;
4231+
switch (i) {
4232+
/* JIT has no effect on these opcodes */
4233+
case ZEND_BEGIN_SILENCE:
4234+
case ZEND_END_SILENCE:
4235+
case ZEND_EXIT:
4236+
break;
4237+
default:
4238+
if (zend_get_user_opcode_handler(i) != NULL) {
4239+
zend_error(E_WARNING, "JIT is incompatible with third party extensions that setup user opcode handlers. JIT disabled.");
4240+
JIT_G(enabled) = 0;
4241+
JIT_G(on) = 0;
4242+
return FAILURE;
4243+
}
42364244
}
42374245
}
42384246

0 commit comments

Comments
 (0)