summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-01-30 12:46:11 +0100
committerAnatol Belski <ab@php.net>2017-01-30 12:46:11 +0100
commitde64adeb1ddd49fc763a3941792a701fef1a8132 (patch)
tree30dccba7d5d1dabf4100b3a1f45ffd3905e851fa
parente6bc4f39a27c8a91df48cf9ab2de76eb1b7c81c0 (diff)
parent368958b3e4ad341da02c901bfd58296d55d91605 (diff)
downloadphp-git-de64adeb1ddd49fc763a3941792a701fef1a8132.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: 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 479a9aa0b5..9574e43d6f 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)) { \