Skip to content

[pull] master from php:master#1113

Merged
pull[bot] merged 7 commits into
turkdevops:masterfrom
php:master
Jul 22, 2026
Merged

[pull] master from php:master#1113
pull[bot] merged 7 commits into
turkdevops:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Jul 22, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


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

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

devnexen and others added 7 commits July 22, 2026 06:50
Fix #22447

xmlHasProp() matches an attribute by local name only, ignoring its
namespace, whereas xmlAddChild()/xmlAddPrevSibling() dedup an incoming
no-namespace attribute via xmlHasNsProp(..., NULL), which matches only
attributes with no namespace. When both a no-namespace and a namespaced
attribute share a local name, the pre-insertion check unlinked the wrong
(namespaced) attribute, leaving libxml to free the still-wrapped
no-namespace duplicate and producing a use-after-free at request
shutdown.

Use xmlHasNsProp(..., NULL) so the pre-insertion check matches libxml's
internal duplicate detection, as advised by @nwellnhof.

Close GH-22452
* PHP-8.4:
  ext/dom: fix UAF when setting an attribute colliding by local name.
* PHP-8.5:
  ext/dom: fix UAF when setting an attribute colliding by local name.
…andler() (#22764)

Fixes GH-22763.

The reproducer triggers an assertion failure in `zend_jit_use_reg()` because a var has `jit->ra[var].ref == IR_NULL` but `jit->ra[var].flags` doesn't contain `ZREG_LOAD`.

This happens because of the following events:
 * An in-register variable is spilled to the VM stack frame by IR (IR_REG_SPILL_SPECIAL)
 * zend_jit_snapshot_handler() set the stack descriptor to .flags = ZREG_TYPE_ONLY, .reg = ZREG_NONE
 * During a subsequent call to zend_jit_snapshot_handler(), the reg is not IR_REG_SPILL_SPECIAL anymore, so .reg is set but .flags remains ZREG_TYPE_ONLY which is inconsistent
 * A side trace inherits from this stack descriptor
 * zend_jit_trace_deoptimization() doesn't set `jit->ra[var].ref` for this var because `.flags == ZREG_TYPE_ONLY`, which causes the assertion failure later

Fix by removing irrelevant flags when setting reg in zend_jit_snapshot_handler().
* PHP-8.5:
  Clear ZREG_TYPE_ONLY flag for in-register vars in zend_jit_snapshot_handler() (#22764)
Preloading will try to evaluate class constants during compilation but
evaluated FCCs are objects, which can not be persisted. Apply the same fix as
for enums: Fail evaluation when compiling.

Preloading will also reset CG(map_ptr_last) after compilation, which results in
collisions if map ptrs were allocated during compilation. Move the
ZEND_MAP_PTR_NEW() to the persist phase, as a shared map ptr is not necessary
before that.

Fixes GH-22782.
* PHP-8.5:
  Fix const expr support in preloading (#22783)
@pull pull Bot locked and limited conversation to collaborators Jul 22, 2026
@pull pull Bot added the ⤵️ pull label Jul 22, 2026
@pull
pull Bot merged commit be82abb into turkdevops:master Jul 22, 2026
0 of 2 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.

2 participants