File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,13 @@ static zend_string* ZEND_FASTCALL zend_new_interned_string_request(zend_string *
234
234
}
235
235
236
236
/* Create a short living interned, freed after the request. */
237
- ZEND_ASSERT (!(GC_FLAGS (str ) & GC_PERSISTENT ));
237
+ #if ZEND_RC_DEBUG
238
+ if (zend_rc_debug ) {
239
+ /* PHP shouldn't create persistent interned string during request,
240
+ * but at least dl() may do this */
241
+ ZEND_ASSERT (!(GC_FLAGS (str ) & GC_PERSISTENT ));
242
+ }
243
+ #endif
238
244
if (GC_REFCOUNT (str ) > 1 ) {
239
245
zend_ulong h = ZSTR_H (str );
240
246
zend_string_delref (str );
@@ -257,6 +263,7 @@ static zend_string* ZEND_FASTCALL zend_string_init_interned_permanent(const char
257
263
return ret ;
258
264
}
259
265
266
+ ZEND_ASSERT (permanent );
260
267
ret = zend_string_init (str , size , permanent );
261
268
ZSTR_H (ret ) = h ;
262
269
return zend_add_interned_string (ret , & interned_strings_permanent , IS_STR_PERMANENT );
@@ -278,6 +285,13 @@ static zend_string* ZEND_FASTCALL zend_string_init_interned_request(const char *
278
285
return ret ;
279
286
}
280
287
288
+ #if ZEND_RC_DEBUG
289
+ if (zend_rc_debug ) {
290
+ /* PHP shouldn't create persistent interned string during request,
291
+ * but at least dl() may do this */
292
+ ZEND_ASSERT (!permanent );
293
+ }
294
+ #endif
281
295
ret = zend_string_init (str , size , permanent );
282
296
ZSTR_H (ret ) = h ;
283
297
You can’t perform that action at this time.
0 commit comments