1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Fix enabling of JIT at runtime

Fixes GH-14267
Closes GH-14294
This commit is contained in:
Ilija Tovilo
2024-05-22 12:20:24 +02:00
parent 151f56b376
commit 9506ca6001
4 changed files with 38 additions and 3 deletions

4
NEWS
View File

@@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.2.21
- Opcache:
. Fixed bug GH-14267 (opcache.jit=off does not allow enabling JIT at runtime).
(ilutov)
- SPL:
. Fixed bug GH-14290 (Member access within null pointer in extension spl).
(nielsdos)

View File

@@ -4785,12 +4785,12 @@ ZEND_EXT_API int zend_jit_config(zend_string *jit, int stage)
return FAILURE;
}
if (ZSTR_LEN(jit) == 0
|| zend_string_equals_literal_ci(jit, "disable")) {
if (zend_string_equals_literal_ci(jit, "disable")) {
JIT_G(enabled) = 0;
JIT_G(on) = 0;
return SUCCESS;
} else if (zend_string_equals_literal_ci(jit, "0")
} else if (ZSTR_LEN(jit) == 0
|| zend_string_equals_literal_ci(jit, "0")
|| zend_string_equals_literal_ci(jit, "off")
|| zend_string_equals_literal_ci(jit, "no")
|| zend_string_equals_literal_ci(jit, "false")) {

View File

@@ -0,0 +1,16 @@
--TEST--
GH-14267: JIT cannot be enabled at runtime
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.jit=off
opcache.jit_buffer_size=32M
--EXTENSIONS--
opcache
--FILE--
<?php
ini_set('opcache.jit', 'tracing');
?>
===DONE===
--EXPECT--
===DONE===

View File

@@ -0,0 +1,15 @@
--TEST--
GH-14267: JIT cannot be enabled at runtime
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.jit=disable
opcache.jit_buffer_size=32M
--EXTENSIONS--
opcache
--FILE--
<?php
ini_set('opcache.jit', 'tracing');
?>
--EXPECTF--
Warning: Cannot change opcache.jit setting at run-time (JIT is disabled) in %s on line %d