Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Sep 11, 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 : )

ndossche and others added 11 commits September 11, 2025 19:35
…ception are triggered

If an exception _and_ a warning (or deprecation) is emitted, then the
result is destroyed twice. Use an `else if` to prevent this.
This is tested via zend_test because the deprecation that triggered the
original reproducer may disappear in the future.

Closes GH-19793.
* PHP-8.3:
  Fix GH-19792: SCCP causes UAF for return value if both warning and exception are triggered
* PHP-8.4:
  Fix GH-19792: SCCP causes UAF for return value if both warning and exception are triggered
See GH-19701 for discussion.
This now restores the (correct) serialization output from versions
PHP 7.4.1 and below.

Closes GH-19762.
* PHP-8.3:
  Fix GH-19701: Serialize/deserialize loses some data
* PHP-8.4:
  Fix GH-19701: Serialize/deserialize loses some data
* uri: Do not pass `uri_internal_t` to property handlers

Within an individual property handler, the `parser` is already implicitly
known, which just leaves the `->uri` field which must contain the entire state
necessary for the handlers to work with.

Pass the `->uri` directly. It avoids one pointer indirection, since the
handlers do not need to follow the pointer to the `uri_internal_t` just to
follow the pointer to the URI state.  Instead the URI pointer can directly be
passed using a register with the dereferences (if necessary) happening in the
caller, providing more insight for the compiler to work with.

It also makes it more convenient to use the handlers directly for code that
already knows that it needs a specific URI parser, since no `uri_internal_t`
needs to be constructed to store the already-known information about which
parser to use.

* uri: Use local variable for the URI in `uri_get_debug_properties()`

This makes the code a little less verbose.
* uri: Do not check the return value of `uri_property_handler_from_internal_uri()`

It's impossible for this function to return `NULL`, since it will always return
a positive offset into a struct.

* uri: Optimize `php_uri_get_*()`

Currently the `php_uri_get_*()` functions call into `php_uri_get_property()`
with a constant `php_uri_property_name`. This name will then be used to look up
the correct property handler by a function in a different compilation unit.

Improve this by making `uri_property_handler_from_internal_uri` take a
`php_uri_parser` rather than a `uri_internal_t`, defining it in a header as
inlinable (and renaming it to better match its updated purpose).

This allows the compiler to fully inline `php_uri_get_property()`, such that no
dynamic lookups will need to happen.

* uri: Eliminate `php_uri_get_property()` entirely

Spelling out the effective implementation explicitly is not much longer than
going through `php_uri_get_property()`, but much more explicit in what is
happening.
@pull pull bot locked and limited conversation to collaborators Sep 11, 2025
@pull pull bot added the ⤵️ pull label Sep 11, 2025
@pull pull bot merged commit 3e9caf5 into wudi:master Sep 11, 2025
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.

2 participants