Skip to content

Commit

Permalink
Don't optimize function if inference failed
Browse files Browse the repository at this point in the history
This was respected only for the single-function optimizations, not
in func-info mode.
  • Loading branch information
nikic committed Oct 25, 2018
1 parent 78c2e0e commit b9431ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ext/opcache/Optimizer/zend_optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,8 +1488,11 @@ int zend_optimize_script(zend_script *script, zend_long optimization_level, zend
for (i = 0; i < call_graph.op_arrays_count; i++) {
func_info = ZEND_FUNC_INFO(call_graph.op_arrays[i]);
if (func_info) {
zend_dfa_analyze_op_array(call_graph.op_arrays[i], &ctx, &func_info->ssa);
func_info->flags = func_info->ssa.cfg.flags;
if (zend_dfa_analyze_op_array(call_graph.op_arrays[i], &ctx, &func_info->ssa) == SUCCESS) {
func_info->flags = func_info->ssa.cfg.flags;
} else {
ZEND_SET_FUNC_INFO(call_graph.op_arrays[i], NULL);
}
}
}

Expand Down

0 comments on commit b9431ef

Please sign in to comment.