Skip to content

Commit 3f6e664

Browse files
committed
Zend/zend_exceptions: Add const modifiers
1 parent f61ae00 commit 3f6e664

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Zend/zend_exceptions.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int zend_implement_throwable(zend_class_entry *interface, zend_class_entr
6767
{
6868
/* zend_ce_exception and zend_ce_error may not be initialized yet when this is called (e.g when
6969
* implementing Throwable for Exception itself). Perform a manual inheritance check. */
70-
zend_class_entry *root = class_type;
70+
const zend_class_entry *root = class_type;
7171
while (root->parent) {
7272
root = root->parent;
7373
}
@@ -89,13 +89,13 @@ static int zend_implement_throwable(zend_class_entry *interface, zend_class_entr
8989
}
9090
/* }}} */
9191

92-
static inline zend_class_entry *i_get_exception_base(zend_object *object) /* {{{ */
92+
static inline zend_class_entry *i_get_exception_base(const zend_object *object) /* {{{ */
9393
{
9494
return instanceof_function(object->ce, zend_ce_exception) ? zend_ce_exception : zend_ce_error;
9595
}
9696
/* }}} */
9797

98-
ZEND_API zend_class_entry *zend_get_exception_base(zend_object *object) /* {{{ */
98+
ZEND_API zend_class_entry *zend_get_exception_base(const zend_object *object) /* {{{ */
9999
{
100100
return i_get_exception_base(object);
101101
}
@@ -192,7 +192,7 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /*
192192
#endif /* HAVE_DTRACE */
193193

194194
if (exception != NULL) {
195-
zend_object *previous = EG(exception);
195+
const zend_object *previous = EG(exception);
196196
if (previous && zend_is_unwind_exit(previous)) {
197197
/* Don't replace unwinding exception with different exception. */
198198
OBJ_RELEASE(exception);

Zend/zend_exceptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception);
4848

4949
void zend_register_default_exception(void);
5050

51-
ZEND_API zend_class_entry *zend_get_exception_base(zend_object *object);
51+
ZEND_API zend_class_entry *zend_get_exception_base(const zend_object *object);
5252

5353
/* Deprecated - Use zend_ce_exception directly instead */
5454
ZEND_API zend_class_entry *zend_exception_get_default(void);

0 commit comments

Comments
 (0)