From: Xinchen Hui Date: Sun, 28 Feb 2016 03:50:06 +0000 (+0800) Subject: Fixed segfault with file_cache_only X-Git-Tag: php-7.0.5RC1~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c053d44e473f6b9e65d50ce81029b5849d9e105;p=php Fixed segfault with file_cache_only --- diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index 6625fe23c3..deae886991 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -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) {