Stdlib: AOT quotemeta via self-contained NestedJIT helper (#27011) - #27867
Merged
Merged
Conversation
Avoid VmString::quotemeta under NestedJIT (ExternalMethod stub / segfault) by inlining StrRot13-shaped per-char match escape — branched if-in-loop empties helper-runtime unit.o under NestedJIT emit. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 5, 2026
Regression: AOT quotemeta() segfaults after build — VM/JIT match Zend (ext/standard/string.c)
#27011
Closed
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
quotemeta()no longer segfaults:QuotemetaJitHelperis self-contained (noVmString::quotemetaunder NestedJIT — peer#16075/str_rot13/strrev).escapeChar+match(StrRot13 shape). Branchedifinside the byte loop empties helper-runtimeunit.ounder NestedJIT emit.QuotemetaJitHelper; addedtest/repro/issue_27011_aot_quotemeta.php+QuotemetaAot27011Test(10× run).php-src:
ext/standard/string.c—PHP_FUNCTION(quotemeta)PHP:
ext/standard/QuotemetaJitHelper.php+lib/JIT/Builtin/StringQuotemeta.phpCloses #27011
Test plan
php bin/vm.php/jitof repro →a\.betc. match Zendphp bin/compile.php -o … test/repro/issue_27011_aot_quotemeta.php+ binary ×10 → match Zendvendor/bin/phpunit --filter 'QuotemetaRuntimeShrinkTest|QuotemetaAot27011Test'→ OK (4 tests, 44 assertions)Not covered: full
ci-fast/ compliance; KeySort/ValueSort helper-runtime stale on tip from #27863 (pre-existing).Pillar probe:
user_release_ready=no—north-star5-fastgen-0 4f-m on master (#27860 claimed by trust-gate); this PR does not touch gen-0.Made with Cursor