[php-src] PR #20059: Fix GH-20043: array_unique assertion failure with RC1 array causing an exception on sort
| From: | nielsdos | Date: | Sat, 04 Oct 2025 13:00:39 +0000 |
| Subject: | [php-src] PR #20059: Fix GH-20043: array_unique assertion failure with RC1 array causing an exception on sort | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-33481@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/20059
Author: nielsdos
The reason this happens is because the array_unique operation happens in-place because the input
array is RC1.
At one point during comparison an exception is thrown which will capture the arguments in the
backtrace, which will increment the refcount of the RC1 array to 2. Then a modification happens
after the throw on the RC2 array causing the assertion failure.
We shouldn't try continue work after an exception happened during the sort.