summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-01-30 12:47:29 +0100
committerAnatol Belski <ab@php.net>2017-01-30 12:47:29 +0100
commit46bdb637ec9cfc4cfa7e4b2518d3c6751bbb47a5 (patch)
treeda7054146dddc531de8adeb39adee034f278e704
parent82d363c21b738195a966a51404b52abaff33f0c3 (diff)
parentde64adeb1ddd49fc763a3941792a701fef1a8132 (diff)
downloadphp-git-46bdb637ec9cfc4cfa7e4b2518d3c6751bbb47a5.tar.gz
Merge branch 'PHP-7.1'
* PHP-7.1: Fixed bug #73983 crash on finish work with phar in cli + opcache
-rw-r--r--ext/opcache/zend_persist.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index e67184f757..7d0f8dc861 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -33,6 +33,18 @@
#define zend_accel_memdup(p, size) \
_zend_shared_memdup((void*)p, size, 0)
+#ifdef HAVE_OPCACHE_FILE_CACHE
+#define zend_set_str_gc_flags(str) do { \
+ if (ZCG(accel_directives).file_cache_only) { \
+ GC_FLAGS(str) = IS_STR_INTERNED; \
+ } else { \
+ GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
+ } \
+} while (0)
+#else
+#define zend_set_str_gc_flags(str) GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT
+#endif
+
#define zend_accel_store_string(str) do { \
zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \
if (new_str) { \
@@ -43,13 +55,13 @@
zend_string_release(str); \
str = new_str; \
zend_string_hash_val(str); \
- GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
+ zend_set_str_gc_flags(str); \
} \
} while (0)
#define zend_accel_memdup_string(str) do { \
str = zend_accel_memdup(str, _ZSTR_STRUCT_SIZE(ZSTR_LEN(str))); \
zend_string_hash_val(str); \
- GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
+ zend_set_str_gc_flags(str); \
} while (0)
#define zend_accel_store_interned_string(str) do { \
if (!IS_ACCEL_INTERNED(str)) { \