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

Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Fix GH-18639: Internal class aliases can break preloading + JIT
This commit is contained in:
Niels Dossche
2025-06-23 20:01:40 +02:00
3 changed files with 33 additions and 1 deletions

4
NEWS
View File

@@ -21,6 +21,10 @@ PHP NEWS
- MbString:
. Fixed bug GH-18901 (integer overflow mb_split). (nielsdos)
- Opcache:
. Fixed bug GH-18639 (Internal class aliases can break preloading + JIT).
(nielsdos)
- Standard:
. Fix misleading errors in printf(). (nielsdos)

View File

@@ -3302,8 +3302,16 @@ int zend_jit_script(zend_script *script)
|| JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
zend_class_entry *ce;
zend_op_array *op_array;
zval *zv;
ZEND_HASH_MAP_FOREACH_VAL(&script->class_table, zv) {
if (Z_TYPE_P(zv) == IS_ALIAS_PTR) {
continue;
}
ce = Z_PTR_P(zv);
ZEND_ASSERT(ce->type == ZEND_USER_CLASS);
ZEND_HASH_MAP_FOREACH_PTR(&script->class_table, ce) {
ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, op_array) {
if (!ZEND_FUNC_INFO(op_array)) {
void *jit_extension = zend_shared_alloc_get_xlat_entry(op_array->opcodes);

View File

@@ -0,0 +1,20 @@
--TEST--
GH-18639 (Internal class aliases can break preloading + JIT)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.jit=1255
opcache.jit_buffer_size=16M
opcache.preload={PWD}/preload_gh18567.inc
--EXTENSIONS--
opcache
--SKIPIF--
<?php
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
?>
--FILE--
<?php
echo "ok\n";
?>
--EXPECT--
ok