mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Fix handling of static properties initialized to arrays
This commit is contained in:
parent
4ff5341fb0
commit
7bbbd5035d
@ -1659,7 +1659,7 @@ ZEND_API char *zend_get_module_version(char *module_name)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type)
|
||||
ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC)
|
||||
{
|
||||
zend_property_info property_info;
|
||||
HashTable *target_symbol_table;
|
||||
@ -1683,6 +1683,8 @@ ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_le
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
zval_update_constant(&property, (void *) 1 TSRMLS_CC);
|
||||
}
|
||||
switch (access_type & ZEND_ACC_PPP_MASK) {
|
||||
case ZEND_ACC_PRIVATE: {
|
||||
@ -1727,7 +1729,7 @@ ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_le
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type)
|
||||
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC)
|
||||
{
|
||||
zval *property;
|
||||
|
||||
@ -1737,10 +1739,10 @@ ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int na
|
||||
ALLOC_ZVAL(property);
|
||||
}
|
||||
INIT_ZVAL(*property);
|
||||
return zend_declare_property(ce, name, name_length, property, access_type);
|
||||
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type)
|
||||
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
|
||||
{
|
||||
zval *property;
|
||||
|
||||
@ -1751,10 +1753,10 @@ ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int na
|
||||
}
|
||||
INIT_PZVAL(property);
|
||||
ZVAL_LONG(property, value);
|
||||
return zend_declare_property(ce, name, name_length, property, access_type);
|
||||
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type)
|
||||
ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC)
|
||||
{
|
||||
zval *property;
|
||||
int len = strlen(value);
|
||||
@ -1767,7 +1769,7 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
|
||||
ZVAL_STRINGL(property, value, len, 1);
|
||||
}
|
||||
INIT_PZVAL(property);
|
||||
return zend_declare_property(ce, name, name_length, property, access_type);
|
||||
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC)
|
||||
|
@ -165,10 +165,10 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_
|
||||
ZEND_API void zend_wrong_param_count(TSRMLS_D);
|
||||
ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name);
|
||||
ZEND_API char *zend_get_module_version(char *module_name);
|
||||
ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type);
|
||||
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type);
|
||||
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type);
|
||||
ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type);
|
||||
ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC);
|
||||
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC);
|
||||
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
|
||||
ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC);
|
||||
ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC);
|
||||
@ -473,7 +473,7 @@ ZEND_API ZEND_FUNCTION(display_disabled_class);
|
||||
{ \
|
||||
char *_name = (name); \
|
||||
int namelen = strlen(_name); \
|
||||
zend_declare_property(class_ptr, _name, namelen, value, mask); \
|
||||
zend_declare_property(class_ptr, _name, namelen, value, mask TSRMLS_CC); \
|
||||
}
|
||||
|
||||
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
|
||||
|
@ -2407,7 +2407,7 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
|
||||
property->type = IS_NULL;
|
||||
}
|
||||
|
||||
zend_declare_property(CG(active_class_entry), var_name->u.constant.value.str.val, var_name->u.constant.value.str.len, property, access_type);
|
||||
zend_declare_property(CG(active_class_entry), var_name->u.constant.value.str.val, var_name->u.constant.value.str.len, property, access_type TSRMLS_CC);
|
||||
efree(var_name->u.constant.value.str.val);
|
||||
}
|
||||
|
||||
|
@ -364,12 +364,12 @@ static void zend_register_default_exception(TSRMLS_D)
|
||||
default_exception_ptr = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
default_exception_ptr->create_object = zend_default_exception_new;
|
||||
|
||||
zend_declare_property_string(default_exception_ptr, "message", sizeof("message")-1, "Unknown exception", ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_string(default_exception_ptr, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE);
|
||||
zend_declare_property_long(default_exception_ptr, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_null(default_exception_ptr, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_null(default_exception_ptr, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_null(default_exception_ptr, "trace", sizeof("trace")-1, ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_string(default_exception_ptr, "message", sizeof("message")-1, "Unknown exception", ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_string(default_exception_ptr, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC);
|
||||
zend_declare_property_long(default_exception_ptr, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_null(default_exception_ptr, "file", sizeof("file")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_null(default_exception_ptr, "line", sizeof("line")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_null(default_exception_ptr, "trace", sizeof("trace")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API zend_class_entry *zend_exception_get_default(void)
|
||||
|
@ -364,12 +364,12 @@ static void zend_register_default_exception(TSRMLS_D)
|
||||
default_exception_ptr = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
default_exception_ptr->create_object = zend_default_exception_new;
|
||||
|
||||
zend_declare_property_string(default_exception_ptr, "message", sizeof("message")-1, "Unknown exception", ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_string(default_exception_ptr, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE);
|
||||
zend_declare_property_long(default_exception_ptr, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_null(default_exception_ptr, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_null(default_exception_ptr, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_null(default_exception_ptr, "trace", sizeof("trace")-1, ZEND_ACC_PROTECTED);
|
||||
zend_declare_property_string(default_exception_ptr, "message", sizeof("message")-1, "Unknown exception", ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_string(default_exception_ptr, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC);
|
||||
zend_declare_property_long(default_exception_ptr, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_null(default_exception_ptr, "file", sizeof("file")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_null(default_exception_ptr, "line", sizeof("line")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
zend_declare_property_null(default_exception_ptr, "trace", sizeof("trace")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API zend_class_entry *zend_exception_get_default(void)
|
||||
|
Loading…
Reference in New Issue
Block a user