Category
bug · AOT mbstring NestedJIT leftover of #6050
Problem
mb_scrub() matches Zend on the VM for runtime invalid UTF-8, but thin standalone AOT refuses non-literal $string with:
mb_scrub() JIT requires compile-time string and encoding literals in this compiler build
Literal folds already work via JitMbScrub::tryCompileTimeFold. Peer leftovers (#34309 mb_convert_encoding, #34298 mb_preferred_mime_name) used NestedJIT helpers for the same gap.
Verified on master @ c34c5b0 (aot-smoke 8/8):
| Repro |
Zend 8.2 |
AOT |
$s = 'a' . chr(0x80) . 'b'; echo bin2hex(mb_scrub($s)); |
613f62 |
compile LogicException |
php-src reference
PHP implementation target
ext/mbstring/JitMbScrub.php — NestedJIT runtime path (peer JitMbConvertEncoding)
ext/mbstring/MbScrubJitHelper.php + lib/JIT/Builtin/MbScrubRuntime.php — php-in-PHP helper
ext/mbstring/mb_scrub.php — wire call() through invoke
Repro
./script/aot-smoke.sh # must stay 8/8
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/aot_mb_scrub_runtime.php'
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/mbscrub.bin test/repro/aot_mb_scrub_runtime.php && /tmp/mbscrub.bin'
Done when
Category
bug· AOT mbstring NestedJIT leftover of #6050Problem
mb_scrub()matches Zend on the VM for runtime invalid UTF-8, but thin standalone AOT refuses non-literal$stringwith:mb_scrub() JIT requires compile-time string and encoding literals in this compiler buildLiteral folds already work via
JitMbScrub::tryCompileTimeFold. Peer leftovers (#34309mb_convert_encoding, #34298mb_preferred_mime_name) used NestedJIT helpers for the same gap.Verified on master @ c34c5b0 (aot-smoke 8/8):
$s = 'a' . chr(0x80) . 'b'; echo bin2hex(mb_scrub($s));613f62php-src reference
ext/mbstring/mbstring.c—PHP_FUNCTION(mb_scrub)PHP implementation target
ext/mbstring/JitMbScrub.php— NestedJIT runtime path (peerJitMbConvertEncoding)ext/mbstring/MbScrubJitHelper.php+lib/JIT/Builtin/MbScrubRuntime.php— php-in-PHP helperext/mbstring/mb_scrub.php— wirecall()through invokeRepro
Done when
mb_scrub()AOT matches Zend (UTF-8 / ASCII / 8BIT)./script/aot-smoke.shstill 8/8runtime/*.c— NestedJIT only