Expand description
Stack-overflow protection for the recursive analysis passes.
Expression/statement analysis recurses along the AST (e.g. a fluent
->a()->b()->… chain), and on-demand return-type inference nests whole
body analyses of other files on the same stack. Worker threads usually have
only 2 MiB, so deep input must grow the stack on the heap instead of aborting.
Structs§
- Guarded
Parse - A parse result whose deeply nested AST is dropped on a stack large enough for the recursive
Drop.
Constants§
- STACK_
SIZE - Stack size for analysis worker threads; matches rust-analyzer and ty.
Functions§
- ensure_
phase_ stack - Runs
fwith enough stack for an unguarded analysis phase. - ensure_
stack - Runs
f, continuing on a heap-allocated stack segment when the current one is nearly exhausted. - parse
- Parses
sourcewith the default PHP version; seeparse_versioned. - parse_
versioned - Parses
source, guaranteeing enough stack for deeply nested input. - walk_
block - Guarded
php_ast::owned::visitor::walk_owned_block. - walk_
expr - Guarded
php_ast::owned::visitor::walk_owned_expr; visitors recurse through it. - walk_
stmt - Guarded
php_ast::owned::visitor::walk_owned_stmt.