diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-07-20 23:28:05 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-07-20 23:28:05 +0300 |
commit | 1b9d0c8af374442ed9341ef473db59f9f259110f (patch) | |
tree | 83fba04718e4d7265edd7f132dcaa122ef981c0f /ext/opcache/Optimizer/scdf.c | |
parent | b8eb110cd5b1e862429d893c1acd6dc9959c8e01 (diff) | |
download | php-git-1b9d0c8af374442ed9341ef473db59f9f259110f.tar.gz |
Fixed wrong edges_count re-calculation.
Diffstat (limited to 'ext/opcache/Optimizer/scdf.c')
-rw-r--r-- | ext/opcache/Optimizer/scdf.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/opcache/Optimizer/scdf.c b/ext/opcache/Optimizer/scdf.c index add8741af6..7482b0eff5 100644 --- a/ext/opcache/Optimizer/scdf.c +++ b/ext/opcache/Optimizer/scdf.c @@ -81,13 +81,6 @@ void scdf_mark_edge_feasible(scdf_ctx *scdf, int from, int to) { } void scdf_init(zend_optimizer_ctx *ctx, scdf_ctx *scdf, zend_op_array *op_array, zend_ssa *ssa) { - uint32_t edges_count = 0; - int b; - - for (b = 0; b < ssa->cfg.blocks_count; b++) { - edges_count += ssa->cfg.blocks[b].predecessors_count; - } - scdf->op_array = op_array; scdf->ssa = ssa; @@ -96,7 +89,7 @@ void scdf_init(zend_optimizer_ctx *ctx, scdf_ctx *scdf, zend_op_array *op_array, scdf->block_worklist_len = zend_bitset_len(ssa->cfg.blocks_count); scdf->instr_worklist = zend_arena_calloc(&ctx->arena, - scdf->instr_worklist_len + scdf->phi_var_worklist_len + 2 * scdf->block_worklist_len + zend_bitset_len(edges_count), + scdf->instr_worklist_len + scdf->phi_var_worklist_len + 2 * scdf->block_worklist_len + zend_bitset_len(ssa->cfg.edges_count), sizeof(zend_ulong)); scdf->phi_var_worklist = scdf->instr_worklist + scdf->instr_worklist_len; |