mirror of
https://github.com/php/php-src.git
synced 2026-04-29 19:23:22 +02:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix GH-18639: Internal class aliases can break preloading + JIT
This commit is contained in:
@@ -3449,8 +3449,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);
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user