Skip to content

Commit 26b35ca

Browse files
committed
Make zend_get_exception_base static.
Soap extension can use other API functions.
1 parent 434a466 commit 26b35ca

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

Zend/zend_exceptions.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ static zend_class_entry *type_error_ce;
3838
static zend_object_handlers default_exception_handlers;
3939
ZEND_API void (*zend_throw_exception_hook)(zval *ex);
4040

41-
ZEND_API zend_class_entry *zend_get_exception_base(zval *object)
41+
static zend_class_entry *zend_get_exception_base(zval *object)
4242
{
43-
if (instanceof_function(Z_OBJCE_P(object), error_ce)) {
44-
return error_ce;
45-
}
46-
47-
return default_exception_ce;
43+
return instanceof_function(Z_OBJCE_P(object), default_exception_ce) ? default_exception_ce : error_ce;
4844
}
4945

5046
void zend_exception_set_previous(zend_object *exception, zend_object *add_previous)

Zend/zend_exceptions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ ZEND_API void zend_throw_exception_internal(zval *exception);
3434

3535
void zend_register_default_exception(void);
3636

37-
ZEND_API zend_class_entry *zend_get_exception_base(zval *object);
38-
3937
ZEND_API zend_class_entry *zend_exception_get_default(void);
4038
ZEND_API zend_class_entry *zend_get_error_exception(void);
4139
ZEND_API zend_class_entry *zend_get_error(void);

ext/soap/soap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ static void _soap_server_exception(soapServicePtr service, sdlFunctionPtr functi
14991499
} else if (instanceof_function(Z_OBJCE(exception_object), zend_get_error())) {
15001500
if (service->send_errors) {
15011501
zval rv;
1502-
zend_string *msg = zval_get_string(zend_read_property(zend_get_exception_base(&exception_object), &exception_object, "message", sizeof("message")-1, 0, &rv));
1502+
zend_string *msg = zval_get_string(zend_read_property(zend_get_error(), &exception_object, "message", sizeof("message")-1, 0, &rv));
15031503
add_soap_fault_ex(&exception_object, this_ptr, "Server", msg->val, NULL, NULL);
15041504
zend_string_release(msg);
15051505
} else {
@@ -2602,7 +2602,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
26022602
zval exception_object;
26032603

26042604
ZVAL_OBJ(&exception_object, EG(exception));
2605-
msg = zval_get_string(zend_read_property(zend_get_exception_base(&exception_object), &exception_object, "message", sizeof("message")-1, 0, &rv));
2605+
msg = zval_get_string(zend_read_property(zend_get_error(), &exception_object, "message", sizeof("message")-1, 0, &rv));
26062606
/* change class */
26072607
EG(exception)->ce = soap_fault_class_entry;
26082608
set_soap_fault(&exception_object, NULL, "Client", msg->val, NULL, NULL, NULL);

0 commit comments

Comments
 (0)