diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 11b615c214a9f..a4e1c2f98c6ce 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -193,7 +193,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; } } diff --git a/ext/zend_test/tests/gh17408.phpt b/ext/zend_test/tests/gh17408.phpt new file mode 100644 index 0000000000000..f54a7b81fce9c --- /dev/null +++ b/ext/zend_test/tests/gh17408.phpt @@ -0,0 +1,22 @@ +--TEST-- +GH-17408 (Assertion failure Zend/zend_exceptions.c) +--EXTENSIONS-- +zend_test +--FILE-- + +--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