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

Remove zend_exception_save() and zend_exception_restore()

These are leftovers from the pre-PHP-7.0 era. This also implicitly solves
GH-20564 by not clearing exceptions before entering the autoloader.

Closes GH-20256
Fixes GH-20564
This commit is contained in:
Ilija Tovilo
2025-10-22 01:03:43 +02:00
parent 8b4ef3a09f
commit 084e409694
15 changed files with 32 additions and 63 deletions

View File

@@ -134,7 +134,6 @@ ZEND_ATTRIBUTE_UNUSED static void create_file(void) {
ZEND_ATTRIBUTE_UNUSED static void opcache_invalidate(void) {
steps_left = MAX_STEPS;
zend_exception_save();
zval retval, args[2];
zend_function *fn = zend_hash_str_find_ptr(CG(function_table), ZEND_STRL("opcache_invalidate"));
ZEND_ASSERT(fn != NULL);
@@ -145,5 +144,4 @@ ZEND_ATTRIBUTE_UNUSED static void opcache_invalidate(void) {
ZEND_ASSERT(Z_TYPE(retval) == IS_TRUE);
zval_ptr_dtor(&args[0]);
zval_ptr_dtor(&retval);
zend_exception_restore();
}

View File

@@ -716,10 +716,6 @@ static inline void phpdbg_handle_exception(void) /* {{{ */
phpdbg_writeln("%s", ZSTR_VAL(msg));
zend_string_release(msg);
if (EG(prev_exception)) {
OBJ_RELEASE(EG(prev_exception));
EG(prev_exception) = 0;
}
OBJ_RELEASE(ex);
EG(opline_before_exception) = NULL;
@@ -876,7 +872,6 @@ free_cmd:
} zend_end_try();
if (restore) {
zend_exception_restore();
zend_try {
zend_try_exception_handler();
PHPDBG_G(in_execution) = 1;