AOT: fix mb_trim NestedJIT ABI (SIGSEGV/empty) leftover of #34388 - #34396
Merged
Merged
Conversation
Use two-string public helpers and ascending no-break private bodies so NestedJIT keeps __string__* params and does not SIGSEGV under thin AOT. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
added a commit
that referenced
this pull request
Aug 24, 2026
) MbTrimJitHelper used substr() and index-subtraction patterns that thin AOT miscompiles; rewrite rtrim with byte indexing, copyPrefix, and C2-hold NBSP deferral so runtime haystack trim matches VM/Zend. Co-authored-by: PurHur <PurHur@users.noreply.github.com> 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
trimDefault/ltrimDefault/rtrimDefault/trimChars) + private ascending no-break bodies (ASCII ws + U+00A0). No newruntime/*.c.ext/mbstring/mbstring.c—PHP_FUNCTION(mb_trim)/mb_ltrim/mb_rtrim.Test plan
./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4 PHP_COMPILER_HELPER_RUNTIME_O=0; php bin/vm.php test/repro/aot_mb_trim_runtime.php > /tmp/mbv.out; php bin/compile.php -o /tmp/mbrt test/repro/aot_mb_trim_runtime.php; /tmp/mbrt > /tmp/mba.out; diff -u /tmp/mbv.out /tmp/mba.out; echo DIFF=$?'→ DIFF=0./script/phpunit.sh --filter MbTrimRuntimeAotTest→ OK (2 tests, 14 assertions)./script/docker-exec.sh -- bash -lc './script/aot-smoke.sh'→ 8/8Not run:
north-star5-verify --strict, fullci-local, release-readiness.Made with Cursor