Skip to content

php-in-php: drop always-on LibcExtern strlen after NestedJIT module-local (#32068) - #32072

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-strlen-libc-extern
Aug 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-strlen-libc-extern

Conversation

@PurHur

@PurHur PurHur commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Drop the always-on LibcExtern strlen(3) row. User-script strlen() already lives in PHP (ext/types/strlen.php + JitStrlen / VmString::byteLength).
  • NestedJIT C-string length leaves call LibcExtern::ensureStrlenDecl() before lookupFunction('strlen'). EMBED MCJIT still gets implementStrlenBody after the module-local decl.
  • Drop the Module::jitInit always-on strlen fallback (peer php-in-php: drop always-on LibcExtern strtod after NestedJIT module-local (#31988 shape) #31997 strtod).

Closes #32068

php-src: ext/standard/string.c PHP_FUNCTION(strlen) / Zend Z_STRLEN — not libc strlen on user values.

C runtime: no runtime/*.c added. Always-on libc strlen row removed from lib/JIT/LibcExtern.php ('strlen' => gone); thin ensureStrlenDecl() trampoline only.

Test plan

  • ./script/phpunit.sh --filter 'LibcExternDeadDeclsRuntimeShrinkTest|StrlenRuntimeShrinkTest|LibcExternMathRuntimeShrinkTest'
  • ./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/nested_trim_strlen.php' → 5
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

.................................                                 33 / 33 (100%)

Time: 00:00.221, Memory: 205.73 MB

OK (33 tests, 583 assertions)

Did not run make test-harness / ci-local.sh / bootstrap link (not compile/link/self-host).

Made with Cursor

…ocal (#32068)

User-script strlen() already lives in ext/types JitStrlen / VmString. NestedJIT
C-string length leaves now call ensureStrlenDecl() instead of an always-on libc row.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 1bff930 into master Aug 18, 2026
1 check failed
@PurHur
PurHur deleted the agent/runtime-php-strlen-libc-extern branch August 18, 2026 04: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.

php-in-php: drop always-on LibcExtern strlen after NestedJIT module-local (#31997 shape)

1 participant