Merge branch 'PHP-8.4'

* PHP-8.4:
  Fix GH-17408: Assertion failure Zend/zend_exceptions.c
This commit is contained in:
Niels Dossche 2025-01-21 08:21:27 +01:00
commit 3786b721e8
No known key found for this signature in database
GPG key ID: A17A7C526FE17078
2 changed files with 22 additions and 1 deletions

View file

@ -194,7 +194,6 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /*
zend_exception_set_previous(exception, EG(exception));
EG(exception) = exception;
if (previous) {
ZEND_ASSERT(is_handle_exception_set() && "HANDLE_EXCEPTION not set?");
return;
}
}

View file

@ -0,0 +1,22 @@
--TEST--
GH-17408 (Assertion failure Zend/zend_exceptions.c)
--EXTENSIONS--
zend_test
--FILE--
<?php
function test() {
$resource = zend_test_create_throwing_resource();
zend_test_create_throwing_resource();
}
test();
?>
--EXPECTF--
Fatal error: Uncaught Exception: Throwing resource destructor called in %s:%d
Stack trace:
#0 %s(%d): test()
#1 {main}
Next Exception: Throwing resource destructor called in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d