Merge branch 'PHP-8.3'

* PHP-8.3:
  Fix GH-15901: phpdbg: Assertion failure on `i funcs`
This commit is contained in:
Christoph M. Becker 2024-09-18 23:51:27 +02:00
commit 7a8767fe62
No known key found for this signature in database
GPG Key ID: D66C9593118BCCB6
3 changed files with 44 additions and 27 deletions

3
NEWS
View File

@ -23,6 +23,9 @@ PHP NEWS
- Opcache: - Opcache:
. Fixed bug GH-15657 (Segmentation fault in dasm_x86.h). (nielsdos) . Fixed bug GH-15657 (Segmentation fault in dasm_x86.h). (nielsdos)
- PHPDBG:
. Fixed bug GH-15901 (phpdbg: Assertion failure on i funcs). (cmb)
- PCRE: - PCRE:
. Fix UAF issues with PCRE after request shutdown. (nielsdos) . Fix UAF issues with PCRE after request shutdown. (nielsdos)

View File

@ -399,6 +399,7 @@ PHPDBG_INFO(classes) /* {{{ */
phpdbg_notice("User Classes (%d)", zend_hash_num_elements(&classes)); phpdbg_notice("User Classes (%d)", zend_hash_num_elements(&classes));
/* once added, assume that classes are stable... until shutdown. */ /* once added, assume that classes are stable... until shutdown. */
if (HT_IS_INITIALIZED(&classes)) {
ZEND_HASH_PACKED_FOREACH_PTR(&classes, ce) { ZEND_HASH_PACKED_FOREACH_PTR(&classes, ce) {
phpdbg_print_class_name(ce); phpdbg_print_class_name(ce);
@ -420,6 +421,7 @@ PHPDBG_INFO(classes) /* {{{ */
phpdbg_writeln("|---- no source code"); phpdbg_writeln("|---- no source code");
} }
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
}
zend_hash_destroy(&classes); zend_hash_destroy(&classes);
@ -445,6 +447,7 @@ PHPDBG_INFO(funcs) /* {{{ */
phpdbg_notice("User Functions (%d)", zend_hash_num_elements(&functions)); phpdbg_notice("User Functions (%d)", zend_hash_num_elements(&functions));
if (HT_IS_INITIALIZED(&functions)) {
ZEND_HASH_PACKED_FOREACH_PTR(&functions, zf) { ZEND_HASH_PACKED_FOREACH_PTR(&functions, zf) {
zend_op_array *op_array = &zf->op_array; zend_op_array *op_array = &zf->op_array;
@ -456,6 +459,7 @@ PHPDBG_INFO(funcs) /* {{{ */
phpdbg_writeln(" (no source code)"); phpdbg_writeln(" (no source code)");
} }
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
}
zend_hash_destroy(&functions); zend_hash_destroy(&functions);

View File

@ -0,0 +1,10 @@
--TEST--
GH-15901 (phpdbg: Assertion failure on `i funcs`)
--PHPDBG--
i funcs
i classes
--EXPECT--
prompt> [User Functions (0)]
prompt> [User Classes (0)]
prompt> [User Classes (0)]
prompt>