mirror of
https://github.com/php/php-src.git
synced 2024-11-27 20:03:40 +08:00
commit
47ccdecf00
4
NEWS
4
NEWS
@ -7,6 +7,10 @@ PHP NEWS
|
||||
. Fixed bug #81346 (Non-seekable streams don't update position after write).
|
||||
(cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #81353 (segfault with preloading and statically bound closure).
|
||||
(Nikita)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #81351 (xml_parse may fail, but has no error code). (cmb, Nikita)
|
||||
|
||||
|
@ -4599,6 +4599,20 @@ static int accel_preload(const char *config, zend_bool in_child)
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
if (Z_TYPE(EG(user_error_handler)) != IS_UNDEF) {
|
||||
zval_ptr_dtor(&EG(user_error_handler));
|
||||
ZVAL_UNDEF(&EG(user_error_handler));
|
||||
}
|
||||
|
||||
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
|
||||
zval_ptr_dtor(&EG(user_exception_handler));
|
||||
ZVAL_UNDEF(&EG(user_exception_handler));
|
||||
}
|
||||
|
||||
zend_stack_clean(&EG(user_error_handlers_error_reporting), NULL, 1);
|
||||
zend_stack_clean(&EG(user_error_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1);
|
||||
zend_stack_clean(&EG(user_exception_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1);
|
||||
|
||||
CG(map_ptr_last) = orig_map_ptr_last;
|
||||
|
||||
if (EG(full_tables_cleanup)) {
|
||||
|
8
ext/opcache/tests/preload_error_handler.inc
Normal file
8
ext/opcache/tests/preload_error_handler.inc
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
set_error_handler(function($_, $m) {
|
||||
static $x;
|
||||
var_dump($m);
|
||||
});
|
||||
|
||||
opcache_compile_file(__DIR__ . '/preload_error_handler_ind.inc');
|
17
ext/opcache/tests/preload_error_handler.phpt
Normal file
17
ext/opcache/tests/preload_error_handler.phpt
Normal file
@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #81353: Segfault with preloading and error handler using static variables
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
opcache.preload={PWD}/preload_error_handler.inc
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
|
||||
?>
|
||||
--FILE--
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: Can't preload unlinked class B: Unknown parent A in %s on line %d
|
||||
===DONE===
|
4
ext/opcache/tests/preload_error_handler_ind.inc
Normal file
4
ext/opcache/tests/preload_error_handler_ind.inc
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
// Cause a preload warning
|
||||
class B extends A {}
|
Loading…
Reference in New Issue
Block a user