mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed pointer allignment
This commit is contained in:
parent
b273a8cbe4
commit
d9231b1667
2 changed files with 12 additions and 12 deletions
|
@ -1640,11 +1640,11 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
|
|||
ALLOCA_FLAG(use_heap);
|
||||
|
||||
worklist = do_alloca(
|
||||
sizeof(zend_ulong) * worklist_len +
|
||||
sizeof(int) * ssa->vars_count +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zend_ulong) * worklist_len) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->vars_count) +
|
||||
sizeof(int) * ssa->sccs, use_heap);
|
||||
next_scc_var = (int*)(worklist + worklist_len);
|
||||
scc_var = next_scc_var + ssa->vars_count;
|
||||
next_scc_var = (int*)((char*)worklist + ZEND_MM_ALIGNED_SIZE(sizeof(zend_ulong) * worklist_len));
|
||||
scc_var = (int*)((char*)next_scc_var + ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->vars_count));
|
||||
|
||||
LOG_SSA_RANGE("Range Inference\n");
|
||||
|
||||
|
|
|
@ -77,12 +77,12 @@ static zend_ssa_phi *add_pi(
|
|||
}
|
||||
|
||||
phi = zend_arena_calloc(arena, 1,
|
||||
sizeof(zend_ssa_phi) +
|
||||
sizeof(int) * ssa->cfg.blocks[to].predecessors_count +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->cfg.blocks[to].predecessors_count) +
|
||||
sizeof(void*) * ssa->cfg.blocks[to].predecessors_count);
|
||||
phi->sources = (int*)(((char*)phi) + sizeof(zend_ssa_phi));
|
||||
phi->sources = (int*)(((char*)phi) + ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)));
|
||||
memset(phi->sources, 0xff, sizeof(int) * ssa->cfg.blocks[to].predecessors_count);
|
||||
phi->use_chains = (zend_ssa_phi**)(((char*)phi->sources) + sizeof(int) * ssa->cfg.blocks[to].predecessors_count);
|
||||
phi->use_chains = (zend_ssa_phi**)(((char*)phi->sources) + ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->cfg.blocks[to].predecessors_count));
|
||||
|
||||
phi->pi = from;
|
||||
phi->var = var;
|
||||
|
@ -947,13 +947,13 @@ int zend_build_ssa(zend_arena **arena, const zend_script *script, const zend_op_
|
|||
if (!zend_bitset_empty(phi + j * set_size, set_size)) {
|
||||
ZEND_BITSET_REVERSE_FOREACH(phi + j * set_size, set_size, i) {
|
||||
zend_ssa_phi *phi = zend_arena_calloc(arena, 1,
|
||||
sizeof(zend_ssa_phi) +
|
||||
sizeof(int) * blocks[j].predecessors_count +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(int) * blocks[j].predecessors_count) +
|
||||
sizeof(void*) * blocks[j].predecessors_count);
|
||||
|
||||
phi->sources = (int*)(((char*)phi) + sizeof(zend_ssa_phi));
|
||||
phi->sources = (int*)(((char*)phi) + ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)));
|
||||
memset(phi->sources, 0xff, sizeof(int) * blocks[j].predecessors_count);
|
||||
phi->use_chains = (zend_ssa_phi**)(((char*)phi->sources) + sizeof(int) * ssa->cfg.blocks[j].predecessors_count);
|
||||
phi->use_chains = (zend_ssa_phi**)(((char*)phi->sources) + ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->cfg.blocks[j].predecessors_count));
|
||||
|
||||
phi->pi = -1;
|
||||
phi->var = i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue