mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: jit: fixed "Uninitialized string offset" warning being emitted at the same time as invalid offset Error
This commit is contained in:
commit
52463ae233
4
NEWS
4
NEWS
@ -11,6 +11,10 @@ PHP NEWS
|
||||
. Fixed bug GH-12791 (Possible dereference of NULL in MySQLnd debug code).
|
||||
(nielsdos)
|
||||
|
||||
- Opcache:
|
||||
. Fixed JIT bug (Function JIT emits "Uninitialized string offset" warning
|
||||
at the same time as invalid offset Error). (Girgias)
|
||||
|
||||
- Standard
|
||||
. Fixed GH-12745 (http_build_query() default null argument for $arg_separator
|
||||
is implicitly coerced to string). (Girgias)
|
||||
|
@ -1100,6 +1100,9 @@ static zend_string* ZEND_FASTCALL zend_jit_fetch_dim_str_r_helper(zend_string *s
|
||||
} else {
|
||||
offset = Z_LVAL_P(dim);
|
||||
}
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
return ZSTR_EMPTY_ALLOC();
|
||||
}
|
||||
return zend_jit_fetch_dim_str_offset(str, offset);
|
||||
}
|
||||
|
||||
|
20
ext/opcache/tests/jit/gh12723-A.phpt
Normal file
20
ext/opcache/tests/jit/gh12723-A.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
GH-12723: Function JIT emits "Uninitialized string offset" warning at the same time as invalid offset Error
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$container = '';
|
||||
$dimension = [];
|
||||
|
||||
try {
|
||||
var_dump($container[$dimension]);
|
||||
} catch (\Throwable $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot access offset of type array on string
|
Loading…
Reference in New Issue
Block a user