Share zval_make_interned_string() helper

The same function was defined in zend_compile.c and zend_API.c.
This commit is contained in:
Nikita Popov 2021-07-23 16:10:34 +02:00
parent 36d2dd087a
commit c4f4f1ece7
3 changed files with 2 additions and 11 deletions

View File

@ -4024,16 +4024,6 @@ ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
}
/* }}} */
static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
{
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));
if (ZSTR_IS_INTERNED(Z_STR_P(zv))) {
Z_TYPE_FLAGS_P(zv) = 0;
}
return Z_STR_P(zv);
}
static zend_always_inline bool is_persistent_class(zend_class_entry *ce) {
return (ce->type & ZEND_INTERNAL_CLASS)
&& ce->info.internal.module->type == MODULE_PERSISTENT;

View File

@ -501,7 +501,7 @@ static int lookup_cv(zend_string *name) /* {{{ */{
}
/* }}} */
static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
zend_string *zval_make_interned_string(zval *zv)
{
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));

View File

@ -815,6 +815,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline);
ZEND_API void function_add_ref(zend_function *function);
void zend_init_static_variables_map_ptr(zend_op_array *op_array);
zend_string *zval_make_interned_string(zval *zv);
#define INITIAL_OP_ARRAY_SIZE 64