1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Mark zend_visibility_string as returning a const char* (#19951)

This is because the char* returned is immutable and should not be modified.
This commit is contained in:
Gina Peter Banyard
2025-09-25 10:28:13 +01:00
committed by GitHub
parent d77d44e1f7
commit 39d6bc1716
2 changed files with 2 additions and 2 deletions

View File

@@ -443,7 +443,7 @@ static zend_always_inline uint32_t zend_visibility_to_set_visibility(uint32_t vi
// Must not clash with ZEND_SHORT_CIRCUITING_CHAIN_MASK
#define ZEND_JMP_NULL_BP_VAR_IS 4
char *zend_visibility_string(uint32_t fn_flags);
const char *zend_visibility_string(uint32_t fn_flags);
#define ZEND_PROPERTY_HOOK_COUNT 2
#define ZEND_PROPERTY_HOOK_STRUCT_SIZE (sizeof(zend_function*) * ZEND_PROPERTY_HOOK_COUNT)

View File

@@ -200,7 +200,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
}
/* }}} */
char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
const char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
{
if (fn_flags & ZEND_ACC_PUBLIC) {
return "public";