Skip to content

Commit de64ade

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #73983 crash on finish work with phar in cli + opcache
2 parents e6bc4f3 + 368958b commit de64ade

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

ext/opcache/zend_persist.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
#define zend_accel_memdup(p, size) \
3434
_zend_shared_memdup((void*)p, size, 0)
3535

36+
#ifdef HAVE_OPCACHE_FILE_CACHE
37+
#define zend_set_str_gc_flags(str) do { \
38+
if (ZCG(accel_directives).file_cache_only) { \
39+
GC_FLAGS(str) = IS_STR_INTERNED; \
40+
} else { \
41+
GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
42+
} \
43+
} while (0)
44+
#else
45+
#define zend_set_str_gc_flags(str) GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT
46+
#endif
47+
3648
#define zend_accel_store_string(str) do { \
3749
zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \
3850
if (new_str) { \
@@ -43,13 +55,13 @@
4355
zend_string_release(str); \
4456
str = new_str; \
4557
zend_string_hash_val(str); \
46-
GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
58+
zend_set_str_gc_flags(str); \
4759
} \
4860
} while (0)
4961
#define zend_accel_memdup_string(str) do { \
5062
str = zend_accel_memdup(str, _ZSTR_STRUCT_SIZE(ZSTR_LEN(str))); \
5163
zend_string_hash_val(str); \
52-
GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
64+
zend_set_str_gc_flags(str); \
5365
} while (0)
5466
#define zend_accel_store_interned_string(str) do { \
5567
if (!IS_ACCEL_INTERNED(str)) { \

0 commit comments

Comments
 (0)