Skip to content

Commit d6f70f0

Browse files
committed
Disable block pass for large functions
(Backport of 7ea2616 to 7.0.)
1 parent 5c93a31 commit d6f70f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/opcache/Optimizer/block_pass.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,10 @@ void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
20002000
return;
20012001
}
20022002

2003+
if ((uint64_t) op_array->last * (op_array->last_var + op_array->T) > 512 * 1024 * 1024) {
2004+
return;
2005+
}
2006+
20032007
/* Build CFG */
20042008
checkpoint = zend_arena_checkpoint(ctx->arena);
20052009
if (!find_code_blocks(op_array, &cfg, ctx)) {

0 commit comments

Comments
 (0)