Skip to content

Fix AOT preg_match_all abort — thin match-all $matches (#27195) - #27378

Merged
PurHur merged 2 commits into
masterfrom
agent/issue-27195-aot-preg-match-all
Aug 3, 2026
Merged

PurHur merged 2 commits into
masterfrom
agent/issue-27195-aot-preg-match-all

Conversation

@PurHur

@PurHur PurHur commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

php-src: ext/pcre/php_pcre.c PHP_FUNCTION(preg_match_all) / php_pcre_match_impl

Test plan

  • Issue repro (Docker), ×5:
    PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o /tmp/pma test/repro/issue_27195_aot_preg_match_all.php
    /tmp/pma   # a,b,c  (exit 0 ×5)
  • vendor/bin/phpunit --filter 'PregAotFastPathTest|PregMatchRuntimeShrinkTest' — OK (14 tests)
  • Debug binary: n=3 isset0=1 arr=1 then a,b,c

TRY_FIRST gates (master): release-readiness inventory OK; north-star5-fast red on gen-0 fingerprint mismatch (#8713) — pre-existing; not touched by this PR.

Made with Cursor

PurHur and others added 2 commits August 3, 2026 17:52
Thin AOT reused preg_match caps for preg_match_all, so $matches[0] was a
string and implode aborted. Store all full matches and build nested HT.

Co-authored-by: Cursor <cursoragent@cursor.com>
Custom match-all loop returned 0 under NestedJIT; drive advances via the
proven matchCount path instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 75802cb into master Aug 3, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-27195-aot-preg-match-all branch August 3, 2026 17:55
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: AOT preg_match_all() aborts after build — VM/JIT match Zend (ext/pcre/php_pcre.c)

1 participant