]> granicus.if.org Git - php/commitdiff
Fixed segfault with file_cache_only
authorXinchen Hui <laruence@gmail.com>
Sun, 28 Feb 2016 03:50:06 +0000 (11:50 +0800)
committerXinchen Hui <laruence@gmail.com>
Sun, 28 Feb 2016 03:50:06 +0000 (11:50 +0800)
ext/opcache/zend_shared_alloc.c

index 6625fe23c314acddbae810ae2ecfc8cfbc23f34d..deae886991c5a24ced103d4a819069eb7652ea25 100644 (file)
@@ -512,6 +512,10 @@ int zend_accel_in_shm(void *ptr)
 {
        int i;
 
+       if (!smm_shared_globals) {
+               return 0;
+       }
+
        for (i = 0; i < ZSMMG(shared_segments_count); i++) {
                if ((char*)ptr >= (char*)ZSMMG(shared_segments)[i]->p &&
                    (char*)ptr < (char*)ZSMMG(shared_segments)[i]->p + ZSMMG(shared_segments)[i]->size) {