Skip to content

fix(hir): keep loop-property hoist off the recursive lowering stack #9194

Description

@proggeramlug

Release blocker discovered by PR #9189 CI.

Failure

The cargo-test job aborts in commands::compile::collect_modules::tests::statically_reachable_trusted_js_package_is_aot_compiled_without_route_entry with a stack overflow on Rust default 2 MiB test threads. The failure reproduces alone on Linux with the CI profile and disappears with PERRY_LOOP_PROPERTY_HOIST=0 or a larger RUST_MIN_STACK.

Root cause

Bisect identifies #9149 (561a555). hoist_loop_invariant_property_array returns Option<(Stmt, Expr, Vec)> directly to recursive lower_body_stmt. In unoptimized test builds the large return place inflates each recursive lowering frame, exhausting the thread stack in an unrelated module-collection fixture.

Required fix and acceptance

  • Keep the successful hoist result pointer-sized at the recursive call site, without disabling the optimization.
  • The isolated module-collection test must pass with the default stack and the CI profile.
  • The loop_property_array_hoist integration suite must still pass with the optimization enabled and disabled.
  • PR cargo-test must pass without setting RUST_MIN_STACK globally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions