com php-src: arena_alloc never returns NULL: ext/op cache/Optimizer/zend_call_graph.c
| From: | Xinchen Hui | Date: | Wed, 09 Mar 2016 10:05:28 +0000 |
| Subject: | com php-src: arena_alloc never returns NULL: ext/op cache/Optimizer/zend_call_graph.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91288@lists.php.net to get a copy of this message | ||
Commit: f2d2e8ceb9fd0eb1ed3bd14282e1950e5327c232
Author: Xinchen Hui <laruence@gmail.com> Wed, 9 Mar 2016 18:05:28 +0800
Parents: 14fec3adf932205024fc69622fb27fcf740ed54d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f2d2e8ceb9fd0eb1ed3bd14282e1950e5327c232
Log:
arena_alloc never returns NULL
Changed paths:
M ext/opcache/Optimizer/zend_call_graph.c
Diff:
diff --git a/ext/opcache/Optimizer/zend_call_graph.c b/ext/opcache/Optimizer/zend_call_graph.c
index 6c1933c..bbc6fb5 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);
}