Merge branch 'PHP-8.1' into PHP-8.2

* PHP-8.1:
  Avoid JIT warning with opcache.jit_buffer_size=0
This commit is contained in:
Ilija Tovilo 2023-10-18 10:49:07 +02:00
commit b49e178563
No known key found for this signature in database
GPG Key ID: A4F5D403F118200A
2 changed files with 21 additions and 1 deletions

View File

@ -3278,7 +3278,11 @@ static zend_result accel_post_startup(void)
|| zend_jit_startup(ZSMMG(reserved), jit_size, reattached) != SUCCESS) {
JIT_G(enabled) = false;
JIT_G(on) = false;
zend_accel_error(ACCEL_LOG_WARNING, "Could not enable JIT!");
/* The JIT is implicitly disabled with opcache.jit_buffer_size=0, so we don't want to
* emit a warning here. */
if (JIT_G(buffer_size) != 0) {
zend_accel_error(ACCEL_LOG_WARNING, "Could not enable JIT!");
}
}
}
#endif

View File

@ -0,0 +1,16 @@
--TEST--
JIT should not emit warning with opcache.jit_buffer_size=0
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.jit=tracing
opcache.jit_buffer_size=0
opcache.log_verbosity_level=2
--EXTENSIONS--
opcache
--FILE--
<?php
var_dump(opcache_get_status()['jit']['enabled'] ?? false);
?>
--EXPECT--
bool(false)