History log of /PHP-8.0/Zend/zend_hash.c (Results 1 – 25 of 440)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2c508c4d 01-Mar-2021 Nikita Popov

Always remove HT iterators, even for uninit HT

Fixes oss-fuzz #31423.


Revision tags: php-8.0.0, php-7.3.25, php-7.4.13, php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24, php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1
# e304468e 12-Oct-2020 Nikita Popov

Deindirect source elements in zend_hash_merge

If the RHS has INDIRECT elements, we do not those to be added to
the LHS verbatim. As we're using UPDATE_INDIRECT, we might even
create

Deindirect source elements in zend_hash_merge

If the RHS has INDIRECT elements, we do not those to be added to
the LHS verbatim. As we're using UPDATE_INDIRECT, we might even
create a nested INDIRECT that way.

This is a side-quest of oss-fuzz #26245.

show more ...


Revision tags: php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23, php-8.0.0beta4
# da0663a3 15-Sep-2020 Nikita Popov

Add GC_TRY_ADDREF macro

That adds a ref if not immutable. Also audit uses of GC_IMMUTABLE
to either use GC_TRY_ADDREF or GC_TRY_PROTECT_RECURSION.


Revision tags: php-7.4.11RC1, php-7.3.23RC1, php-8.0.0beta3, php-7.4.10, php-7.3.22
# fa8d9b11 28-Aug-2020 George Peter Banyard

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functio

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002

show more ...


Revision tags: php-8.0.0beta2, php-7.3.22RC1, php-7.4.10RC1, php-8.0.0beta1, php-7.4.9, php-7.2.33, php-7.3.21, php-8.0.0alpha3, php-7.4.9RC1, php-7.3.21RC1, php-7.4.8, php-7.2.32, php-8.0.0alpha2
# 64931fd3 07-Jul-2020 Nikita Popov

Fixed bug #79792

We need to remove the iterators even if the array is empty (we
will not create one if the first place, but the array may become
empty after the fact).


Revision tags: php-7.3.20, php-8.0.0alpha1, php-7.4.8RC1, php-7.3.20RC1, php-7.4.7, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1, php-7.4.6, php-7.2.31, php-7.4.6RC1, php-7.3.18RC1, php-7.2.30, php-7.4.5, php-7.3.17, php-7.4.5RC1, php-7.3.17RC1, php-7.3.18, php-7.4.4, php-7.2.29, php-7.3.16
# e12b9df0 04-Mar-2020 Nikita Popov

Make sorting stable

Make user-exposed sorts stable, by storing the position of elements
in the original array, and using those positions as a fallback
comparison criterion. The base

Make sorting stable

Make user-exposed sorts stable, by storing the position of elements
in the original array, and using those positions as a fallback
comparison criterion. The base sort is still hybrid q/insert.

The use of true/false comparison functions is deprecated (but still
supported) and should be replaced by -1/0/1 comparison functions,
driven by the <=> operator.

RFC: https://wiki.php.net/rfc/stable_sorting

Closes GH-5236.

show more ...


# 92c4b065 16-Jun-2020 Christoph M. Becker

Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)

Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `asser

Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)

Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds. This may be useful for other compilers as well.

[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>

show more ...


# bb3d4456 15-Jun-2020 Dmitry Stogov

Change GC_COLLECTABLE flag into GC_NOT_COLLECTABLE to simplify GC_MAY_LEAK() check


# 25acc4a6 12-May-2020 George Peter Banyard

Fix [-Wundef] warning in Zend folder


# 90db6f2c 24-Apr-2020 Levi Morrison

Add case insensitive find_ptr hash functions

- zend_hash_find_ptr_lc(ht, zend_string *key)
- zend_hash_str_find_ptr_lc(ht, const char *str, size_t len)

Note that zend_hash_str

Add case insensitive find_ptr hash functions

- zend_hash_find_ptr_lc(ht, zend_string *key)
- zend_hash_str_find_ptr_lc(ht, const char *str, size_t len)

Note that zend_hash_str_find_ptr_lc used to exist in zend_compile.c
as zend_hash_find_ptr_lc. When exporting this I figured it
was best to use the same conventions as the rest of zend_hash.h.

show more ...


# 79a36ff7 15-Apr-2020 Nikita Popov

Fixed bug #79477

Make sure to deindirect properties when creating array.


# 2462f2da 10-Mar-2020 Christoph M. Becker

Fix #79364: When copy empty array, next key is unspecified

We must not forget to keep the `nNextFreeElement` when duplicating
empty arrays.


# 33ef3d64 04-Mar-2020 Nikita Popov

Use separate typedef for bucket comparison function

Avoid performing the same casting dance inside each sort compare
function.


Revision tags: php-7.4.4RC1, php-7.3.16RC1, php-7.4.3, php-7.2.28, php-7.3.15RC1, php-7.4.3RC1
# d91b166c 28-Jan-2020 Nikita Popov

Avoid shift UB for large arrays

Don't shift into the sign bit.


Revision tags: php-7.3.15, php-7.2.27, php-7.4.2, php-7.3.14, php-7.3.14RC1, php-7.4.2RC1, php-7.4.1, php-7.2.26, php-7.3.13, php-7.4.1RC1, php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12, php-7.4.0RC6, php-7.3.12RC1, php-7.2.25RC1, php-7.4.0RC5, php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4, php-7.3.11RC1, php-7.2.24RC1, php-7.4.0RC3, php-7.2.23, php-7.3.10, php-7.4.0RC2
# 358a6b4c 12-Sep-2019 Dmitry Stogov

Reorder conditions


Revision tags: php-7.2.23RC1, php-7.3.10RC1, php-7.4.0RC1, php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4, php-7.2.22RC1, php-7.3.9RC1, php-7.4.0beta2, php-7.1.31, php-7.2.21, php-7.3.8, php-7.4.0beta1, php-7.2.21RC1, php-7.3.8RC1, php-7.4.0alpha3
# 6a9127c1 04-Jul-2019 Nikita Popov

Assert that HT entries using add_new APIs are really new


Revision tags: php-7.3.7, php-7.2.20, php-7.4.0alpha2
# 84c4a4f1 24-Jun-2019 Andrey Gromov

Make zend_hash_rehash() a void function

It always succeeds.

Closes GH-4304.


Revision tags: php-7.3.7RC3, php-7.3.7RC2, php-7.2.20RC2, php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1, php-7.2.19, php-7.3.6, php-7.1.30, php-7.2.19RC1, php-7.3.6RC1, php-7.1.29, php-7.2.18, php-7.3.5, php-7.2.18RC1, php-7.3.5RC1, php-7.2.17, php-7.3.4, php-7.1.28
# 51fb8dc4 26-Mar-2019 Nikita Popov

Add specialized pair construction API

Closes GH-3990.


# 6fad150c 17-Apr-2019 Sebastian Pop

[AArch64] Use NEON to initialize zend_hash

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------------
Benchmark

[AArch64] Use NEON to initialize zend_hash

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------------
BM_hash_init_before 43.6 ns 43.6 ns 16052937
BM_hash_init_after 27.0 ns 27.0 ns 25877296

Patch written by Ali Saidi <alisaidi@amazon.com>
and Sebastian Pop <spop@amazon.com>

show more ...


# bd6ebf40 16-Apr-2019 Nikita Popov

Don't overwrite iterator count during real init


# f9a755d0 16-Apr-2019 Nikita Popov

Fix HT flags copying wrt iterator count

HT_FLAGS() includes the full flag word, including the iterator
count. When we're fully reassigning it, we need to make sure that
we either rea

Fix HT flags copying wrt iterator count

HT_FLAGS() includes the full flag word, including the iterator
count. When we're fully reassigning it, we need to make sure that
we either really do want to copy the iterator count (as in some
cases in array.c) or we need to mask only the actual flag byte.

Add an assert to hash_iterators_del() to make sure the iterator
count is non-zero (which is how I ran into this) and make sure that
the iterator count is correctly preserved during array splicing.

show more ...


# 9a9eed47 16-Apr-2019 Nikita Popov

Fix second part of bug #77903

When a HT iterator is one past the end and we rehash, we need to make
sure that it is move to the new one past the end position, to make
sure that newly

Fix second part of bug #77903

When a HT iterator is one past the end and we rehash, we need to make
sure that it is move to the new one past the end position, to make
sure that newly inserted elements are picked up.

show more ...


# e1b4cabb 16-Apr-2019 Nikita Popov

Partial fix for bug #77903

In the hash position APIs, make sure we always advance to the next
non-undef element and not just when the position is 0 (similar to
what foreach does). Th

Partial fix for bug #77903

In the hash position APIs, make sure we always advance to the next
non-undef element and not just when the position is 0 (similar to
what foreach does). This can happen when the position of an
ArrayIterator is one past its current end and a new element is
inserted not directly at that position because the array is packed.

There is still a bug here (as shown in the tests), but this is a
separate issue that also affects plain array iteration in foreach.

show more ...


# c7a86a38 10-Apr-2019 Nikita Popov

Fix pgsql use after free trying to reuse closed connection

When a connection is closed, we also need to remove the hash entry
from the regular_list, as it now points to freed memory. To

Fix pgsql use after free trying to reuse closed connection

When a connection is closed, we also need to remove the hash entry
from the regular_list, as it now points to freed memory. To do this
store a reverse mapping from the connection to the hash string.

It would be nicer to introduce a wrapping structure for the pgsql
link resource that could store the hash (and notices), but that would
require large changes to the extension, so I'm going for a more
minimal fix here.

show more ...


Revision tags: php-7.3.4RC1, php-7.2.17RC1
# e86cdce5 11-Mar-2019 rjhdby

Make zend_hash_sort() return void

This function always succeeds, so remove the success indicator
return value.


12345678910>>...18