Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jul 31, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

iluuu1994 and others added 8 commits July 31, 2025 13:27
Since GH-17755 self and parent are compile-time resolved. We may now also
encounter this type error at runtime outside of the class itself.

Fixes GH-19304
The function pointer type declaration requires name to be a const char*
Generator::throw() on a running generator is not allowed. It throws "Cannot
resume an already running generator" when trying to resume the generator to
handle the provided exception.

However, when calling Generator::throw() on a generator with a non-Generator
delegate, we release the delegate regardless. If a Fiber was suspended in
the delegate, this causes use after frees when the Fiber is resumed.

Fix this by throwing "Cannot resume an already running generator" earlier.

Fixes GH-19326
Closes GH-19327
* PHP-8.3:
  Prevent throwing in running generator
* PHP-8.4:
  Prevent throwing in running generator
There are 2 issues:
1. When a MULTISORT_ABORT happens, it frees func, but func may point to
   ARRAYG(multisort_func), which would be a problem with nested
   invocations as it can destroy that of the "parent" invocation.
   To solve this, delay assigning to the globals.
2. The old globals were not restored which means that nested invocations
   with different flags will cause a wrong sorting function to be used.

Closes GH-19319.
* PHP-8.3:
  Fix GH-19300: Nested array_multisort invocation with error breaks
* PHP-8.4:
  Fix GH-19300: Nested array_multisort invocation with error breaks
@pull pull bot locked and limited conversation to collaborators Jul 31, 2025
@pull pull bot added the ⤵️ pull label Jul 31, 2025
@pull pull bot merged commit cee8ed2 into wudi:master Jul 31, 2025
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants