Skip to content

Commit 39d6bc1

Browse files
authored
Mark zend_visibility_string as returning a const char* (#19951)
This is because the char* returned is immutable and should not be modified.
1 parent d77d44e commit 39d6bc1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Zend/zend_compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ static zend_always_inline uint32_t zend_visibility_to_set_visibility(uint32_t vi
443443
// Must not clash with ZEND_SHORT_CIRCUITING_CHAIN_MASK
444444
#define ZEND_JMP_NULL_BP_VAR_IS 4
445445

446-
char *zend_visibility_string(uint32_t fn_flags);
446+
const char *zend_visibility_string(uint32_t fn_flags);
447447

448448
#define ZEND_PROPERTY_HOOK_COUNT 2
449449
#define ZEND_PROPERTY_HOOK_STRUCT_SIZE (sizeof(zend_function*) * ZEND_PROPERTY_HOOK_COUNT)

Zend/zend_inheritance.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
200200
}
201201
/* }}} */
202202

203-
char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
203+
const char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
204204
{
205205
if (fn_flags & ZEND_ACC_PUBLIC) {
206206
return "public";

0 commit comments

Comments
 (0)