Skip to content

Commit e843e06

Browse files
committed
clear backtrace when throwing an exception
Without this, the ext/soap tests would trigger a double stack trace: ``` Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '/Users/enorris/workspace/php-src/ex\ t/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998\ /namespace' in /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run:2 #0 /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run(2): SoapClient->__construct('/Users/enorris/...') php#1 {main} thrown in /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run on line 2 Stack trace: #0 /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run(2): SoapClient->__construct('/Users/enorris/...') php#1 {main} ```
1 parent a44ac31 commit e843e06

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Zend/zend_exceptions.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,10 @@ ZEND_API ZEND_COLD zend_result zend_exception_error(zend_object *ex, int severit
904904
ZVAL_OBJ(&exception, ex);
905905
ce_exception = ex->ce;
906906
EG(exception) = NULL;
907+
908+
zval_ptr_dtor(&EG(error_backtrace));
909+
ZVAL_UNDEF(&EG(error_backtrace));
910+
907911
if (ce_exception == zend_ce_parse_error || ce_exception == zend_ce_compile_error) {
908912
zend_string *message = zval_get_string(GET_PROPERTY(&exception, ZEND_STR_MESSAGE));
909913
zend_string *file = zval_get_string(GET_PROPERTY_SILENT(&exception, ZEND_STR_FILE));

0 commit comments

Comments
 (0)