Skip to content

Stdlib: fix AOT hexdec/bindec NestedJIT insert and string ABI (#26884) - #26903

Merged
PurHur merged 2 commits into
masterfrom
agent/stdlib-26884-hexdec-bindec-aot
Aug 2, 2026
Merged

PurHur merged 2 commits into
masterfrom
agent/stdlib-26884-hexdec-bindec-aot

Conversation

@PurHur

@PurHur PurHur commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/standard/math.c — PHP_FUNCTION(hexdec) / PHP_FUNCTION(bindec)
  • PHP implementation: ext/standard/{hexdec,bindec,octdec,base_convert_}.php, MathBaseConvertJitHelper.php, lib/JIT/Builtin/MathBaseConvert{,Runtime}.php

Test plan

  • php vendor/bin/phpunit --filter 'MathBaseConvertRuntimeShrinkTest|HexdecBindecAot26884Test' → OK (7 tests)
  • Docker AOT: php bin/compile.php -o /tmp/h26884 on repro → prints 255 then 10
  • Docker VM: same repro → 255 / 10
  • ./script/check-generated-docs.sh (Docker) → all generated docs in sync
  • Not covered: full ci-local / overflow-to-float path for hexdec('FFFFFFFFFFFFFFFF') under NestedJIT (may still print 0; follow-up if needed)

Made with Cursor

PurHur and others added 2 commits August 2, 2026 09:37
Restore the IR insert block after mid-emit helper/bridge link, pass
__string__* into phpc_basetozval_result, and parse digits with NestedJIT-safe
recursion so AOT matches Zend for the issue repro (255/10).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 36930d9 into master Aug 2, 2026
0 of 2 checks passed
@PurHur

PurHur commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Merged. Verification on this branch:

php vendor/bin/phpunit --filter 'MathBaseConvertRuntimeShrinkTest|HexdecBindecAot26884Test'
# OK (7 tests, 38 assertions)

./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/h26884 build/h26884.php && /tmp/h26884'
# 255
# 10

php bin/vm.php build/h26884.php
# 255
# 10

@PurHur
PurHur deleted the agent/stdlib-26884-hexdec-bindec-aot branch August 2, 2026 09:40
PurHur added a commit that referenced this pull request Aug 2, 2026
… (#26913)

Restore Pillar 1 after #26903 left the committed unit fingerprint-stale
(user_release_ready: no). Rebuilt unit.o/manifest from current source
(deps now include IsFiniteJitHelper).

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Aug 2, 2026
… (#26916)

Restore Pillar 1 after #26903 left the committed unit fingerprint-stale
(user_release_ready: no). Rebuilt unit.o/manifest from current source.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
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 hexdec()/bindec() compile fails — Current basic block has no parent function (ext/standard/math.c)

1 participant