Skip to content

AOT: array_map string builtins + implode variable arrays (#23974) - #24013

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-23974-aot-implode-segfault
Jul 27, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-23974-aot-implode-segfault

Conversation

@PurHur

@PurHur PurHur commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes AOT: Exception::getCode() and two HashTable methods missing at build time (array_slice, implode+array_map) #23974 — e23_implode AOT now matches Zend (x-y / X, Y).
  • ArrayMapLlvm: pure LLVM for array_map(null|compile-time-string) (NestedJIT of ArrayMapJitHelper segfaulted on foreach / VmInternalCall under thin standalone).
  • implode::loadHaystack uses ArrayBuiltinHelper::loadHashTable so KIND_VARIABLE locals are not passed as garbage __hashtable__* (crash was in __hashtable__getNumElements).
  • Helper prefers exportKeyValuePairs for NestedJIT-safe foreach; spine + inventory include ArrayMapLlvm.php.

Test plan

  • script/differential-sweep.sh --aot --dir <e23> --repeat 10 → ok e23_implode.php (10/10 runs)
  • AOT probes: array_map("strtoupper", …), array_map("strval", …), $a=[…]; implode("-", $a) — 5/5 each
  • g04_exception_state AOT still green (3/3)
  • php vendor/bin/phpunit --filter ArrayMapRuntimeShrinkTest|ArrayMapCallbackPolicyTest
  • php script/bootstrap-inventory.php --check → OK 6600/6600
  • php script/check-selfhost-spine-coverage-sync.php → OK

Not covered

Made with Cursor

Thin-standalone NestedJIT of ArrayMapJitHelper segfaulted on foreach/
VmInternalCall; lower null and compile-time string callbacks via
ArrayMapLlvm (Internal::call loop). implode() now loads haystacks
through ArrayBuiltinHelper so KIND_VARIABLE locals are not passed as
garbage __hashtable__* pointers. e23_implode matches Zend 10/10.

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.

AOT: Exception::getCode() and two HashTable methods missing at build time (array_slice, implode+array_map)

1 participant