File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -263,9 +263,7 @@ static void dba_close(dba_info *info)
263
263
info -> hnd -> close (info );
264
264
}
265
265
ZEND_ASSERT (info -> path );
266
- // Cannot use zend_string_release_ex(info->path, info->flags&DBA_PERSISTENT); as this fails GC assertion?
267
- // Zend/zend_rc_debug.c:38: void ZEND_RC_MOD_CHECK(const zend_refcounted_h *): Assertion `(zval_gc_flags(p->u.type_info) & ((1<<7)|(1<<8))) != (1<<7)' failed.
268
- zend_string_free (info -> path );
266
+ zend_string_release_ex (info -> path , info -> flags & DBA_PERSISTENT );
269
267
info -> path = NULL ;
270
268
271
269
if (info -> fp && info -> fp != info -> lock .fp ) {
@@ -459,10 +457,14 @@ static dba_info *php_dba_find(const zend_string *path)
459
457
460
458
static zend_always_inline zend_string * php_dba_zend_string_dup_safe (zend_string * s , bool persistent )
461
459
{
462
- if (ZSTR_IS_INTERNED (s ) && ( !persistent || ( GC_FLAGS ( s ) & IS_STR_PERSISTENT )) ) {
460
+ if (ZSTR_IS_INTERNED (s ) && !persistent ) {
463
461
return s ;
464
462
} else {
465
- return zend_string_init (ZSTR_VAL (s ), ZSTR_LEN (s ), persistent );
463
+ zend_string * duplicated_str = zend_string_init (ZSTR_VAL (s ), ZSTR_LEN (s ), persistent );
464
+ if (persistent ) {
465
+ GC_MAKE_PERSISTENT_LOCAL (duplicated_str );
466
+ }
467
+ return duplicated_str ;
466
468
}
467
469
}
468
470
You can’t perform that action at this time.
0 commit comments