From: Dmitry Stogov Date: Tue, 31 Oct 2017 12:41:51 +0000 (+0300) Subject: Change checks that should be always true into ZEND_ASSERT() (some edge cases may... X-Git-Tag: php-7.3.0alpha1~1127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b84cbefa940bef25cfb464c2d99f03ebcb611e25;p=php Change checks that should be always true into ZEND_ASSERT() (some edge cases may be trapped here). --- diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index 97a2ea474c..1d3d2a66a7 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -34,7 +34,9 @@ ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC case IS_STRING: { zend_string *str = (zend_string*)p; CHECK_ZVAL_STRING_REL(str); - zend_string_free(str); + ZEND_ASSERT(!ZSTR_IS_INTERNED(str)); + ZEND_ASSERT(GC_REFCOUNT(str) == 0); + pefree(str, GC_FLAGS(str) & IS_STR_PERSISTENT); break; } case IS_ARRAY: {