mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
![]() On some systems, like Alpine, the thread stack size is small by default. The last step of SSA construction involves variable renaming that is recursive, and also makes copies of their version of the renamed variables on the stack. This combination causes a stack overflow during compilation on Alpine. Triggerable for example with very long match statements. A stop-gap solution would be to use heap allocated arrays for the renamed variable list, but that would only delay the error as increasing the number of match arms increases the depth of the dominator tree, and will eventually run into the same issue. This patch transforms the algorithm into an iterative one. There are two states stored in a worklist stack: positive numbers indicate that the block still needs to undergo variable renaming. Negative numbers indicate that the block and its dominated children are already renamed. Because 0 is also a valid block number, we bias the block numbers by adding 1. To restore to the right variant when backtracking the "recursive" step, we index into an array pointing to the different variable renaming variants. Closes GH-19083. |
||
---|---|---|
.. | ||
block_pass.c | ||
compact_literals.c | ||
compact_vars.c | ||
dce.c | ||
dfa_pass.c | ||
escape_analysis.c | ||
nop_removal.c | ||
optimize_func_calls.c | ||
optimize_temp_vars_5.c | ||
pass1.c | ||
pass3.c | ||
sccp.c | ||
scdf.c | ||
scdf.h | ||
ssa_integrity.c | ||
zend_call_graph.c | ||
zend_call_graph.h | ||
zend_cfg.c | ||
zend_cfg.h | ||
zend_dfg.c | ||
zend_dfg.h | ||
zend_dump.c | ||
zend_dump.h | ||
zend_func_info.c | ||
zend_func_info.h | ||
zend_func_infos.h | ||
zend_inference.c | ||
zend_inference.h | ||
zend_optimizer.c | ||
zend_optimizer.h | ||
zend_optimizer_internal.h | ||
zend_ssa.c | ||
zend_ssa.h | ||
zend_worklist.h |