Skip to content

AOT: range() module verification fails — RangeIntRuntime BasicBlockHelper appends to user fn (re-#26956/#27211, ext/standard/array.c) #33896

Closed

Description

@PurHur

Category

bug · AOT · module verification · php-src-strict · re-#26956 / #27211

Problem

Thin AOT phpc build of range(1, 5) (and char/float peers) fails LLVM module verification. RangeIntRuntime positions the builder in __range_*__copy but BasicBlockHelper::append prefers Context::$loweringLlvmFunction (the in-flight user/main void fn) when it differs from the insert parent — so range_head / returns land in the wrong function.

Repro Zend AOT (master @ ec45b42)
echo implode(",", range(1, 5)), "\n"; 1,2,3,4,5 Module verification failed — void fn returns __hashtable__*; cross-function args (range_head)
range("a","c") / range(1.0, 3.0, 0.5) match Zend same verify failure

Peer bridges already set loweringLlvmFunction to the ABI fn (HashTableUnionRuntime, PowIntRuntime, BasicBlockHelper::scopeLoweringToFunction #27211).

php-src reference

PHP implementation target

  • lib/JIT/Builtin/RangeIntRuntime.php — set activeFunction + loweringLlvmFunction to the bridge fn while emitting int/char/float bodies (HashTableUnionRuntime shape); restore in finally
  • Unit/compliance guard for range(1,5) AOT compile+run
  • No new runtime/*.c

Repro

./script/aot-smoke.sh   # must stay 8/8
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/r.bin test/repro/aot_range_int.php && /tmp/r.bin'

Done when

  • AOT range(1,5) / char / float peels print Zend-identical output
  • ./script/aot-smoke.sh stays 8/8
  • unit or AOT fixture guard

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 22, 2026
  2. PurHur commented on Aug 22, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-b — starting this run (lane overflow; #32122/#31968 children closed; Trust/AOT module-verify on range())

  3. PurHur commented on Aug 22, 2026

    @PurHur
    OwnerAuthor

    claim: implementer-worker-lane-a — starting this run (lane A: 33896%3==0; prior lane-b overflow claim has no open PR — taking to land)

  4. PurHur commented on Aug 22, 2026

    @PurHur
    OwnerAuthor

    Note: lane-a also had PR #33899 (scopeLoweringToFunction shape); closed as duplicate of merged #33898.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions