summaryrefslogtreecommitdiff
path: root/Zend/zend_string.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-04-18 14:27:05 +0300
committerDmitry Stogov <dmitry@zend.com>2019-04-18 14:27:05 +0300
commit5ffa5217fc35f8304da36c7592514f983ed8a88f (patch)
tree7b0ef205ebc95dfeb7c76b2013987b8f4ef5f323 /Zend/zend_string.c
parent9f0c9b7ad6316b6185a2fc2997bf241785c30120 (diff)
parent3a04adce828767af8204dc106ed7b8d0f261150a (diff)
downloadphp-git-5ffa5217fc35f8304da36c7592514f983ed8a88f.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Check assert only when RC_DEBUG is enabled
Diffstat (limited to 'Zend/zend_string.c')
-rw-r--r--Zend/zend_string.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index b94d4d5334..75e7e6249f 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -232,7 +232,13 @@ static zend_string* ZEND_FASTCALL zend_new_interned_string_request(zend_string *
}
/* Create a short living interned, freed after the request. */
- ZEND_ASSERT(!(GC_FLAGS(str) & GC_PERSISTENT));
+#if ZEND_RC_DEBUG
+ if (zend_rc_debug) {
+ /* PHP shouldn't create persistent interned string during request,
+ * but at least dl() may do this */
+ ZEND_ASSERT(!(GC_FLAGS(str) & GC_PERSISTENT));
+ }
+#endif
if (GC_REFCOUNT(str) > 1) {
zend_ulong h = ZSTR_H(str);
zend_string_delref(str);
@@ -255,6 +261,7 @@ static zend_string* ZEND_FASTCALL zend_string_init_interned_permanent(const char
return ret;
}
+ ZEND_ASSERT(permanent);
ret = zend_string_init(str, size, permanent);
ZSTR_H(ret) = h;
return zend_add_interned_string(ret, &interned_strings_permanent, IS_STR_PERMANENT);
@@ -276,6 +283,13 @@ static zend_string* ZEND_FASTCALL zend_string_init_interned_request(const char *
return ret;
}
+#if ZEND_RC_DEBUG
+ if (zend_rc_debug) {
+ /* PHP shouldn't create persistent interned string during request,
+ * but at least dl() may do this */
+ ZEND_ASSERT(!permanent);
+ }
+#endif
ret = zend_string_init(str, size, permanent);
ZSTR_H(ret) = h;