Skip to content

Fix CallArgv lazy init blocking spine/AOT compile (#197)#10916

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-callargv-lazy-init
Jun 23, 2026
Merged

Fix CallArgv lazy init blocking spine/AOT compile (#197)#10916
PurHur merged 1 commit into
masterfrom
agent/issue-callargv-lazy-init

Conversation

@PurHur

@PurHur PurHur commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Native::call() always emits CallArgv::emitStore() for func_get_args/func_num_args support (Language: Variadic functions (...$args) and func_get_args() #197), but CallArgv::implement() was only reached via Type::ensureExternals().
  • Spine/AOT compile aborted at c:main_before_php with LogicException: CallArgv global not initialized.
  • Fix: lazy-init the LLVM global in emitStore() / load() (idempotent implement()), matching other JIT helper patterns.

Verification

./script/docker-exec.sh -- bash -lc './vendor/bin/phpunit --filter func_get_args_count_jit'
# OK (2 tests, 2 assertions)

./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-link'
# bootstrap-selfhost-link: OK /compiler/build/selfhost

./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-vm-driver-execute-probe'
# bootstrap-selfhost-vm-driver-execute-probe: OK /compiler/build/selfhost-lib-spine-smoke

Bootstrap fallback context: make bootstrap-loop-probe was red on lib spine smoke due to this compile abort; full loop-probe still blocked on separate native parseAndCompile null + stale sidecar (#8559).

Refs #1492, #197

Made with Cursor

…als (#197).

Native::call emits CallArgv storage on every user-function LLVM call; implement()
was only invoked from Type::ensureExternals, so spine/AOT compile aborted with
"CallArgv global not initialized" at c:main_before_php.

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.

1 participant