From 8c053d44e473f6b9e65d50ce81029b5849d9e105 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sun, 28 Feb 2016 11:50:06 +0800 Subject: [PATCH] Fixed segfault with file_cache_only --- ext/opcache/zend_shared_alloc.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.50.1