From d95c53834cec1570b8f3e836cd514d6ae5901e68 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 29 Jul 2020 18:06:42 +0200 Subject: [PATCH] Amendment to OPcache base file removal We fix the erroneous segment size. We also keep the segment pointer at the allocated address, but increase the position instead. --- ext/opcache/shared_alloc_win32.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c index 26bf0539ea..badc2ec488 100644 --- a/ext/opcache/shared_alloc_win32.c +++ b/ext/opcache/shared_alloc_win32.c @@ -311,11 +311,10 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_ } else { ((void**)mapping_base)[0] = mapping_base; ((void**)mapping_base)[1] = (void*)execute_ex; - ((char*)shared_segment->p) += ACCEL_BASE_POINTER_SIZE; } - shared_segment->pos = 0; - shared_segment->size = requested_size; + shared_segment->pos = ACCEL_BASE_POINTER_SIZE; + shared_segment->size = requested_size - ACCEL_BASE_POINTER_SIZE; zend_shared_alloc_unlock_win32(); -- 2.40.0