diff options
-rw-r--r-- | Zend/zend_alloc.c | 4 | ||||
-rw-r--r-- | Zend/zend_opcode.c | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 8689ee8829..a1af2fcc7f 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -764,7 +764,9 @@ static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment) offset = alignment - offset; zend_mm_munmap(ptr, offset); ptr = (char*)ptr + offset; - } else { + alignment -= offset; + } + if (alignment > REAL_PAGE_SIZE) { zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE); } # ifdef MADV_HUGEPAGE diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index c15f6e1bc6..59e62149f2 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -55,6 +55,7 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz op_array->refcount = (uint32_t *) emalloc(sizeof(uint32_t)); *op_array->refcount = 1; op_array->last = 0; + op_array->opcodes = NULL; op_array_alloc_ops(op_array, initial_ops_size); op_array->last_var = 0; |