Skip to content

Commit

Permalink
Fix detection of JIT enabled (#2971)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamluc authored Nov 22, 2024
1 parent 35d1665 commit d123740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions loader/dd_library_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ static bool ddloader_is_opcache_jit_enabled() {
if (php_api_no > 20230831) { // PHP > 8.3 (https://wiki.php.net/rfc/jit_config_defaults)
// opcache.jit == disable (default: disable)
zval *opcache_jit = ddloader_ini_get_configuration(ZEND_STRL("opcache.jit"));
if (!opcache_jit || Z_TYPE_P(opcache_jit) != IS_STRING || strcmp(Z_STRVAL_P(opcache_jit), "disable") == 0 || strcmp(Z_STRVAL_P(opcache_jit), "off") == 0) {
if (!opcache_jit || Z_TYPE_P(opcache_jit) != IS_STRING || Z_STRLEN_P(opcache_jit) == 0 || strcmp(Z_STRVAL_P(opcache_jit), "disable") == 0 || strcmp(Z_STRVAL_P(opcache_jit), "off") == 0) {
return false;
}
} else {
// opcache.jit_buffer_size = 0 (default: 0)
zval *opcache_jit_buffer_size = ddloader_ini_get_configuration(ZEND_STRL("opcache.jit_buffer_size"));
if (!opcache_jit_buffer_size || Z_TYPE_P(opcache_jit_buffer_size) != IS_STRING || strcmp(Z_STRVAL_P(opcache_jit_buffer_size), "0") == 0) {
if (!opcache_jit_buffer_size || Z_TYPE_P(opcache_jit_buffer_size) != IS_STRING || Z_STRLEN_P(opcache_jit_buffer_size) == 0 || strcmp(Z_STRVAL_P(opcache_jit_buffer_size), "0") == 0) {
return false;
}
}
Expand Down

0 comments on commit d123740

Please sign in to comment.