Skip to content

Fix convert_uu* AOT compile (bridge BB emission) — #4567#18772

Merged
PurHur merged 2 commits into
masterfrom
agent/stdlib-convert-uu-aot-compile-4567
Jul 14, 2026
Merged

Fix convert_uu* AOT compile (bridge BB emission) — #4567#18772
PurHur merged 2 commits into
masterfrom
agent/stdlib-convert-uu-aot-compile-4567

Conversation

@PurHur

@PurHur PurHur commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference: ext/standard/uuencode.c — PHP bridge in ext/standard/ConvertUuJitHelper.php, standalone AOT LLVM in ext/standard/JitConvertUuBodies.php.

Closes #4567

Verification

source script/php-env.sh

# AOT compile + runtime round-trip
php bin/compile.php -o /tmp/uu - <<'PHP'
<?php
$raw = "Hello\n";
$enc = convert_uuencode($raw);
echo convert_uudecode($enc);
echo (convert_uudecode("bad") === false) ? "\nfalse" : "\nnot-false";
PHP
/tmp/uu
# Hello\n\nfalse, exit 0

vendor/bin/phpunit --filter 'AotTest::testCases.*convert_uuencode' test/aot/AotTest.php
# OK

# VM/JIT TypeError parity
php bin/vm.php test/repro-maintainer/parity_convert_uu_type.php
php bin/jit.php test/repro-maintainer/parity_convert_uu_type.php
# exit 0

vendor/bin/phpunit --filter ConvertUuRuntimeShrinkTest test/unit/ConvertUuRuntimeShrinkTest.php
# OK

./script/ci-fast.sh
# exit 0

Emit decode bridge basic blocks on the bridge function instead of the
active user-script insert function, and save/restore the LLVM insert
block around StringConvertUu::implement() so nested helper lowering
no longer leaves the builder in an invalid state.

Co-authored-by: Cursor <cursoragent@cursor.com>
User-script AOT nested ConvertUuJitHelper segfaults at runtime; defer to
restored LLVM bodies (base64 pattern) while JIT/embed keep PHP bridge.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit a37b4af into master Jul 14, 2026
@PurHur PurHur deleted the agent/stdlib-convert-uu-aot-compile-4567 branch July 14, 2026 05:24
@PurHur

PurHur commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

Maintainer review 2026-07-14: hold merge — PR correctly targets AOT compile (#4567 bridge BB emission) and documents the remaining AOT runtime failure (convert_uuencode return materialization). Please land runtime fix or split compile/runtime PRs; re-run vendor/bin/phpunit --filter 'AotTest::testCases.*convert_uuencode' before merge request.

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.

Stdlib: convert_uuencode()/convert_uudecode() — TypeError for non-string operands (ext/standard/uuencode.c parity)

1 participant