Skip to content

Stdlib: AOT quotemeta via self-contained NestedJIT helper (#27011) - #27867

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-27011-aot-quotemeta
Aug 5, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-27011-aot-quotemeta

Conversation

@PurHur

@PurHur PurHur commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Thin AOT quotemeta() no longer segfaults: QuotemetaJitHelper is self-contained (no VmString::quotemeta under NestedJIT — peer #16075 / str_rot13 / strrev).
  • Escape via private escapeChar + match (StrRot13 shape). Branched if inside the byte loop empties helper-runtime unit.o under NestedJIT emit.
  • Refreshed committed helper-runtime unit for QuotemetaJitHelper; added test/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.php

Closes #27011

Test plan

  • php bin/vm.php / jit of repro → a\.b etc. match Zend
  • php bin/compile.php -o … test/repro/issue_27011_aot_quotemeta.php + binary ×10 → match Zend
  • vendor/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-fast gen-0 4f-m on master (#27860 claimed by trust-gate); this PR does not touch gen-0.

Made with Cursor

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>
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 quotemeta() segfaults after build — VM/JIT match Zend (ext/standard/string.c)

1 participant