Repository navigation
Fix AOT preg_match_all abort — thin match-all $matches (#27195) - #27378
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
preg_match_allno longer aborts onimplode($m[0]).preg_matchcaps, so$m[0]was a string;implodeaborted (exit 134).matchAllStore(via provenmatchCount) + LLVM nested$matches[0]=[…]fromthinMatchAllPart*.php-src:
ext/pcre/php_pcre.cPHP_FUNCTION(preg_match_all)/php_pcre_match_implTest plan
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)n=3 isset0=1 arr=1thena,b,cTRY_FIRST gates (master): release-readiness inventory OK;
north-star5-fastred on gen-0 fingerprint mismatch (#8713) — pre-existing; not touched by this PR.Made with Cursor