]> granicus.if.org Git - php/commitdiff
Amendment to OPcache base file removal
authorChristoph M. Becker <cmbecker69@gmx.de>
Wed, 29 Jul 2020 16:06:42 +0000 (18:06 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Wed, 29 Jul 2020 16:44:08 +0000 (18:44 +0200)
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

index 26bf0539eace89331b6429f88b301b8688e06621..badc2ec4882d9060ca179b72dcf41f52d9e334d6 100644 (file)
@@ -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();