Skip to content

Replace ZEND_ASSUME() by ZEND_ASSERT() in zend_hash_*_ptr setters #14466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Zend/zend_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ static zend_always_inline void *zend_hash_add_ptr(HashTable *ht, zend_string *ke
ZVAL_PTR(&tmp, pData);
zv = zend_hash_add(ht, key, &tmp);
if (zv) {
ZEND_ASSUME(Z_PTR_P(zv));
ZEND_ASSERT(Z_PTR_P(zv));
return Z_PTR_P(zv);
} else {
return NULL;
Expand All @@ -660,7 +660,7 @@ static zend_always_inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string
ZVAL_PTR(&tmp, pData);
zv = zend_hash_add_new(ht, key, &tmp);
if (zv) {
ZEND_ASSUME(Z_PTR_P(zv));
ZEND_ASSERT(Z_PTR_P(zv));
return Z_PTR_P(zv);
} else {
return NULL;
Expand All @@ -674,7 +674,7 @@ static zend_always_inline void *zend_hash_str_add_ptr(HashTable *ht, const char
ZVAL_PTR(&tmp, pData);
zv = zend_hash_str_add(ht, str, len, &tmp);
if (zv) {
ZEND_ASSUME(Z_PTR_P(zv));
ZEND_ASSERT(Z_PTR_P(zv));
return Z_PTR_P(zv);
} else {
return NULL;
Expand All @@ -688,7 +688,7 @@ static zend_always_inline void *zend_hash_str_add_new_ptr(HashTable *ht, const c
ZVAL_PTR(&tmp, pData);
zv = zend_hash_str_add_new(ht, str, len, &tmp);
if (zv) {
ZEND_ASSUME(Z_PTR_P(zv));
ZEND_ASSERT(Z_PTR_P(zv));
return Z_PTR_P(zv);
} else {
return NULL;
Expand All @@ -701,7 +701,7 @@ static zend_always_inline void *zend_hash_update_ptr(HashTable *ht, zend_string

ZVAL_PTR(&tmp, pData);
zv = zend_hash_update(ht, key, &tmp);
ZEND_ASSUME(Z_PTR_P(zv));
ZEND_ASSERT(Z_PTR_P(zv));
return Z_PTR_P(zv);
}

Expand All @@ -711,7 +711,7 @@ static zend_always_inline void *zend_hash_str_update_ptr(HashTable *ht, const ch

ZVAL_PTR(&tmp, pData);
zv = zend_hash_str_update(ht, str, len, &tmp);
ZEND_ASSUME(Z_PTR_P(zv));
ZEND_ASSERT(Z_PTR_P(zv));
return Z_PTR_P(zv);
}

Expand Down Expand Up @@ -809,7 +809,7 @@ static zend_always_inline void *zend_hash_index_update_ptr(HashTable *ht, zend_u

ZVAL_PTR(&tmp, pData);
zv = zend_hash_index_update(ht, h, &tmp);
ZEND_ASSUME(Z_PTR_P(zv));
ZEND_ASSERT(Z_PTR_P(zv));
return Z_PTR_P(zv);
}

Expand All @@ -833,7 +833,7 @@ static zend_always_inline void *zend_hash_next_index_insert_ptr(HashTable *ht, v
ZVAL_PTR(&tmp, pData);
zv = zend_hash_next_index_insert(ht, &tmp);
if (zv) {
ZEND_ASSUME(Z_PTR_P(zv));
ZEND_ASSERT(Z_PTR_P(zv));
return Z_PTR_P(zv);
} else {
return NULL;
Expand Down
Loading