Skip to content

Commit e88cdaa

Browse files
committed
better fix for #63055
1 parent 8bd5e15 commit e88cdaa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Zend/zend_variables.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
4040
TSRMLS_FETCH();
4141

4242
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
43+
/* break possible cycles */
44+
Z_TYPE_P(zvalue) = IS_NULL;
4345
zend_hash_destroy(zvalue->value.ht);
4446
FREE_HASHTABLE(zvalue->value.ht);
4547
}

ext/pcre/php_pcre.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,8 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
547547

548548
/* Overwrite the passed-in value for subpatterns with an empty array. */
549549
if (subpats != NULL) {
550-
zval garbage = *subpats;
550+
zval_dtor(subpats);
551551
array_init(subpats);
552-
zval_dtor(&garbage);
553552
}
554553

555554
subpats_order = global ? PREG_PATTERN_ORDER : 0;

0 commit comments

Comments
 (0)