From: Xinchen Hui Date: Wed, 9 Mar 2016 10:05:28 +0000 (+0800) Subject: arena_alloc never returns NULL X-Git-Tag: php-7.1.0alpha1~519 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2d2e8ceb9fd0eb1ed3bd14282e1950e5327c232;p=php arena_alloc never returns NULL --- diff --git a/ext/opcache/Optimizer/zend_call_graph.c b/ext/opcache/Optimizer/zend_call_graph.c index 6c1933cfac..bbc6fb54f9 100644 --- a/ext/opcache/Optimizer/zend_call_graph.c +++ b/ext/opcache/Optimizer/zend_call_graph.c @@ -277,17 +277,12 @@ int zend_build_call_graph(zend_arena **arena, zend_script *script, uint32_t buil if (zend_foreach_op_array(call_graph, script, zend_op_array_calc) != SUCCESS) { return FAILURE; } - call_graph->op_arrays = (zend_op_array**)zend_arena_calloc(arena, call_graph->op_arrays_count, sizeof(zend_op_array*)); + call_graph->op_arrays = (zend_op_array**)zend_arena_calloc(arena, call_graph->op_arrays_count, sizeof(zend_op_array*)); call_graph->func_infos = (zend_func_info*)zend_arena_calloc(arena, call_graph->op_arrays_count, sizeof(zend_func_info)); - if (!call_graph->op_arrays || !call_graph->func_infos) { - return FAILURE; - } - call_graph->op_arrays_count = 0; if (zend_foreach_op_array(call_graph, script, zend_op_array_collect) != SUCCESS) { return FAILURE; } - for (i = 0; i < call_graph->op_arrays_count; i++) { zend_analyze_calls(arena, script, build_flags, call_graph->op_arrays[i], call_graph->func_infos + i); }