Skip to content

Commit b9431ef

Browse files
committed
Don't optimize function if inference failed
This was respected only for the single-function optimizations, not in func-info mode.
1 parent 78c2e0e commit b9431ef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/opcache/Optimizer/zend_optimizer.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,8 +1488,11 @@ int zend_optimize_script(zend_script *script, zend_long optimization_level, zend
14881488
for (i = 0; i < call_graph.op_arrays_count; i++) {
14891489
func_info = ZEND_FUNC_INFO(call_graph.op_arrays[i]);
14901490
if (func_info) {
1491-
zend_dfa_analyze_op_array(call_graph.op_arrays[i], &ctx, &func_info->ssa);
1492-
func_info->flags = func_info->ssa.cfg.flags;
1491+
if (zend_dfa_analyze_op_array(call_graph.op_arrays[i], &ctx, &func_info->ssa) == SUCCESS) {
1492+
func_info->flags = func_info->ssa.cfg.flags;
1493+
} else {
1494+
ZEND_SET_FUNC_INFO(call_graph.op_arrays[i], NULL);
1495+
}
14931496
}
14941497
}
14951498

0 commit comments

Comments
 (0)