Skip to content

AOT: host-fold DOMXPath attribute-axis evaluate and relative @* query (#32003) - #35715

Merged
PurHur merged 1 commit into
masterfrom
fix/dom-xpath-attr-star-aot-evaluate
Aug 29, 2026
Merged

AOT: host-fold DOMXPath attribute-axis evaluate and relative @* query (#32003)#35715
PurHur merged 1 commit into
masterfrom
fix/dom-xpath-attr-star-aot-evaluate

Conversation

@PurHur

@PurHur PurHur commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Host-fold count(//@*), string(//@*), and //attribute::* in JitDomXPathEvaluateUserScript so thin AOT no longer falls through to the context-less XPath evaluate ABI (SIGSEGV).
  • Host-fold relative query('@*', $ctx) when $ctx is //tag item(0) by rewriting to //tag/@* (JitDomXPathQueryUserScript).
  • Skip bare @* in tryHostTreeAxisCompileTime without / — needs explicit context node.

php-src: ext/dom/xpath.c — attribute axis + DOMXPath::evaluate/query with context.

Verification

./script/aot-smoke.sh
aot-smoke: 8 passed, 0 failed

./script/phpunit.sh --filter 'DomXpathAttrStarEvaluateAotTest|DomXpathAttrStarAotTest'
OK (5 tests, 25 assertions)

Not covered

Fixes #32003 (AOT evaluate/query follow-up; VM/query lengths landed earlier).

Made with Cursor

…#32003).

count(//@*), string(//@*), and query('@*', $ctx) hit the context-less XPath
evaluate/query ABI and SIGSEGV or return empty under thin AOT. Fold via host
Zend for attribute-axis location paths and //tag/@* when context comes from
the prior //tag query.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 1301e50 into master Aug 29, 2026
1 check failed
@PurHur
PurHur deleted the fix/dom-xpath-attr-star-aot-evaluate branch August 29, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: DOMXPath //@* and attribute::* return empty — Zend returns Attr nodes (ext/dom/xpath.c)

1 participant