summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-01-22 13:36:15 +0300
committerDmitry Stogov <dmitry@zend.com>2018-01-22 13:36:15 +0300
commit9cbb5210942c75351a510608013614df7d1666b3 (patch)
treeed5420dd080f7e6fb21a7b34ca039636aaa035be /ext/standard
parent7f51257c0885106d0197f37f2277edede4fc9e59 (diff)
downloadphp-git-9cbb5210942c75351a510608013614df7d1666b3.tar.gz
Access HashTable.u.flags through HT_FLAGS() macro.
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/array.c16
-rw-r--r--ext/standard/var_unserializer.c70
-rw-r--r--ext/standard/var_unserializer.re2
3 files changed, 44 insertions, 44 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 0d6a2c1eea..d6832856b8 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -3047,7 +3047,7 @@ static void php_array_data_shuffle(zval *array) /* {{{ */
p->key = NULL;
}
hash->nNextFreeElement = n_elems;
- if (!(hash->u.flags & HASH_FLAG_PACKED)) {
+ if (!(HT_FLAGS(hash) & HASH_FLAG_PACKED)) {
zend_hash_to_packed(hash);
}
}
@@ -3342,7 +3342,7 @@ PHP_FUNCTION(array_shift)
}
/* re-index like it did before */
- if (Z_ARRVAL_P(stack)->u.flags & HASH_FLAG_PACKED) {
+ if (HT_FLAGS(Z_ARRVAL_P(stack)) & HASH_FLAG_PACKED) {
uint32_t k = 0;
if (EXPECTED(Z_ARRVAL_P(stack)->u.v.nIteratorsCount == 0)) {
@@ -3716,7 +3716,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src) /* {{{ */
zval *src_entry;
zend_string *string_key;
- if ((dest->u.flags & HASH_FLAG_PACKED) && (src->u.flags & HASH_FLAG_PACKED)) {
+ if ((HT_FLAGS(dest) & HASH_FLAG_PACKED) && (HT_FLAGS(src) & HASH_FLAG_PACKED)) {
zend_hash_extend(dest, zend_hash_num_elements(dest) + zend_hash_num_elements(src), 1);
ZEND_HASH_FILL_PACKED(dest) {
ZEND_HASH_FOREACH_VAL(src, src_entry) {
@@ -3874,7 +3874,7 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE
/* copy first array */
array_init_size(return_value, count);
dest = Z_ARRVAL_P(return_value);
- if (src->u.flags & HASH_FLAG_PACKED) {
+ if (HT_FLAGS(src) & HASH_FLAG_PACKED) {
zend_hash_real_init(dest, 1);
ZEND_HASH_FILL_PACKED(dest) {
ZEND_HASH_FOREACH_VAL(src, src_entry) {
@@ -4276,7 +4276,7 @@ PHP_FUNCTION(array_reverse)
/* Initialize return array */
array_init_size(return_value, zend_hash_num_elements(Z_ARRVAL_P(input)));
- if ((Z_ARRVAL_P(input)->u.flags & HASH_FLAG_PACKED) && !preserve_keys) {
+ if ((HT_FLAGS(Z_ARRVAL_P(input)) & HASH_FLAG_PACKED) && !preserve_keys) {
zend_hash_real_init(Z_ARRVAL_P(return_value), 1);
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
ZEND_HASH_REVERSE_FOREACH_VAL(Z_ARRVAL_P(input), entry) {
@@ -4345,7 +4345,7 @@ PHP_FUNCTION(array_pad)
}
array_init_size(return_value, pad_size_abs);
- if (Z_ARRVAL_P(input)->u.flags & HASH_FLAG_PACKED) {
+ if (HT_FLAGS(Z_ARRVAL_P(input)) & HASH_FLAG_PACKED) {
zend_hash_real_init(Z_ARRVAL_P(return_value), 1);
if (pad_size < 0) {
@@ -5756,7 +5756,7 @@ PHP_FUNCTION(array_multisort)
hash = Z_ARRVAL_P(arrays[i]);
hash->nNumUsed = array_size;
hash->nInternalPointer = 0;
- repack = !(hash->u.flags & HASH_FLAG_PACKED);
+ repack = !(HT_FLAGS(hash) & HASH_FLAG_PACKED);
for (n = 0, k = 0; k < array_size; k++) {
hash->arData[k] = indirect[k][i];
@@ -6154,7 +6154,7 @@ PHP_FUNCTION(array_map)
}
array_init_size(return_value, maxlen);
- zend_hash_real_init(Z_ARRVAL_P(return_value), Z_ARRVAL(arrays[0])->u.flags & HASH_FLAG_PACKED);
+ zend_hash_real_init(Z_ARRVAL_P(return_value), HT_FLAGS(Z_ARRVAL(arrays[0])) & HASH_FLAG_PACKED);
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL(arrays[0]), num_key, str_key, zv) {
fci.retval = &result;
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 83b209b63e..2af099524c 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -440,7 +440,7 @@ string_key:
&& zend_hash_num_elements(&Z_OBJCE_P(rval)->properties_info) > 0) {
zend_property_info *existing_propinfo;
zend_string *new_key;
- const char *unmangled_class = NULL;
+ const char *unmangled_class = NULL;
const char *unmangled_prop;
size_t unmangled_prop_len;
zend_string *unmangled;
@@ -453,7 +453,7 @@ string_key:
unmangled = zend_string_init(unmangled_prop, unmangled_prop_len, 0);
existing_propinfo = zend_hash_find_ptr(&Z_OBJCE_P(rval)->properties_info, unmangled);
- if ((existing_propinfo != NULL)
+ if ((existing_propinfo != NULL)
&& (existing_propinfo->flags & ZEND_ACC_PPP_MASK)) {
if (existing_propinfo->flags & ZEND_ACC_PROTECTED) {
new_key = zend_mangle_property_name(
@@ -599,7 +599,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
return 0;
}
- zend_hash_extend(ht, zend_hash_num_elements(ht) + elements, (ht->u.flags & HASH_FLAG_PACKED));
+ zend_hash_extend(ht, zend_hash_num_elements(ht) + elements, HT_FLAGS(ht) & HASH_FLAG_PACKED);
if (!process_nested_data(UNSERIALIZE_PASSTHRU, ht, elements, 1)) {
if (has_wakeup) {
ZVAL_DEREF(rval);
@@ -672,38 +672,38 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER, int as_key)
{
YYCTYPE yych;
static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,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0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
};
if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
yych = *YYCURSOR;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 0a2446b2aa..41b0c80bf2 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -603,7 +603,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
return 0;
}
- zend_hash_extend(ht, zend_hash_num_elements(ht) + elements, (ht->u.flags & HASH_FLAG_PACKED));
+ zend_hash_extend(ht, zend_hash_num_elements(ht) + elements, HT_FLAGS(ht) & HASH_FLAG_PACKED);
if (!process_nested_data(UNSERIALIZE_PASSTHRU, ht, elements, 1)) {
if (has_wakeup) {
ZVAL_DEREF(rval);