Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_call_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ ZEND_API zend_call_info **zend_build_call_map(zend_arena **arena, const zend_fun
return NULL;
}

map = zend_arena_calloc(arena, sizeof(zend_call_info *), op_array->last);
map = zend_arena_calloc(arena, op_array->last, sizeof(zend_call_info *));
for (call = info->callee_info; call; call = call->next_callee) {
map[call->caller_init_opline - op_array->opcodes] = call;
if (call->caller_call_opline) {
Expand Down
4 changes: 2 additions & 2 deletions Zend/Optimizer/zend_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ ZEND_API void zend_build_cfg(zend_arena **arena, const zend_op_array *op_array,
cfg->blocks_count = blocks_count;

/* Build CFG, Step 2: Build Array of Basic Blocks */
cfg->blocks = blocks = zend_arena_calloc(arena, sizeof(zend_basic_block), blocks_count);
cfg->blocks = blocks = zend_arena_calloc(arena, blocks_count, sizeof(zend_basic_block));

blocks_count = -1;

Expand Down Expand Up @@ -611,7 +611,7 @@ ZEND_API void zend_cfg_build_predecessors(zend_arena **arena, zend_cfg *cfg) /*
}

cfg->edges_count = edges;
cfg->predecessors = predecessors = (int*)zend_arena_calloc(arena, sizeof(int), edges);
cfg->predecessors = predecessors = (int*)zend_arena_calloc(arena, edges, sizeof(int));

edges = 0;
for (b = blocks; b < end; b++) {
Expand Down
4 changes: 2 additions & 2 deletions Zend/Optimizer/zend_worklist.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static inline void zend_worklist_stack_prepare(zend_arena **arena, zend_worklist
{
ZEND_ASSERT(len >= 0);

stack->buf = (int*)zend_arena_calloc(arena, sizeof(*stack->buf), len);
stack->buf = (int*)zend_arena_calloc(arena, len, sizeof(*stack->buf));
stack->len = 0;
stack->capacity = len;
}
Expand Down Expand Up @@ -81,7 +81,7 @@ typedef struct _zend_worklist {
static inline void zend_worklist_prepare(zend_arena **arena, zend_worklist *worklist, int len)
{
ZEND_ASSERT(len >= 0);
worklist->visited = (zend_bitset)zend_arena_calloc(arena, sizeof(zend_ulong), zend_bitset_len(len));
worklist->visited = (zend_bitset)zend_arena_calloc(arena, zend_bitset_len(len), sizeof(zend_ulong));
zend_worklist_stack_prepare(arena, &worklist->stack, len);
}

Expand Down
6 changes: 3 additions & 3 deletions Zend/zend_enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void zend_enum_register_funcs(zend_class_entry *ce)
{
const uint32_t fn_flags =
ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_ARENA_ALLOCATED;
zend_internal_function *cases_function = zend_arena_calloc(&CG(arena), sizeof(zend_internal_function), 1);
zend_internal_function *cases_function = zend_arena_calloc(&CG(arena), 1, sizeof(zend_internal_function));
cases_function->handler = zend_enum_cases_func;
cases_function->function_name = ZSTR_KNOWN(ZEND_STR_CASES);
cases_function->fn_flags = fn_flags;
Expand All @@ -454,7 +454,7 @@ void zend_enum_register_funcs(zend_class_entry *ce)
zend_enum_register_func(ce, ZEND_STR_CASES, cases_function);

if (ce->enum_backing_type != IS_UNDEF) {
zend_internal_function *from_function = zend_arena_calloc(&CG(arena), sizeof(zend_internal_function), 1);
zend_internal_function *from_function = zend_arena_calloc(&CG(arena), 1, sizeof(zend_internal_function));
from_function->handler = zend_enum_from_func;
from_function->function_name = ZSTR_KNOWN(ZEND_STR_FROM);
from_function->fn_flags = fn_flags;
Expand All @@ -464,7 +464,7 @@ void zend_enum_register_funcs(zend_class_entry *ce)
from_function->arg_info = zarginfo_class_BackedEnum_from + 1;
zend_enum_register_func(ce, ZEND_STR_FROM, from_function);

zend_internal_function *try_from_function = zend_arena_calloc(&CG(arena), sizeof(zend_internal_function), 1);
zend_internal_function *try_from_function = zend_arena_calloc(&CG(arena), 1, sizeof(zend_internal_function));
try_from_function->handler = zend_enum_try_from_func;
try_from_function->function_name = ZSTR_KNOWN(ZEND_STR_TRYFROM);
try_from_function->fn_flags = fn_flags;
Expand Down
Loading