com php-src: Use zval_ptr_dtor() instead of zval _dtor() in internal functions that destroy ne w created object (This is safer and produces less
code): ext/phar/phar_object.c ext/reflection /php_reflection.c

From: Date: Thu, 05 Jul 2018 11:25:17 +0000
Subject: com php-src: Use zval_ptr_dtor() instead of zval _dtor() in internal functions that destroy ne w created object (This is safer and produces less
code): ext/phar/phar_object.c ext/reflection /php_reflection.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-102419@lists.php.net to get a copy of this message
Commit: 3780b027ddce2e7dfb62228c89162480d8fbd5ff Author: Dmitry Stogov <dmitry@zend.com> Thu, 5 Jul 2018 14:25:17 +0300 Parents: 91fc0d1a4146eb44dc2b668e65aef9bbec4e071b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3780b027ddce2e7dfb62228c89162480d8fbd5ff Log: Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code) Changed paths: M ext/phar/phar_object.c M ext/reflection/php_reflection.c Diff: diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index f2fd426..2e35145 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1767,7 +1767,7 @@ PHP_METHOD(Phar, buildFromDirectory) if (SUCCESS != object_init_ex(&regexiter, spl_ce_RegexIterator)) { zval_ptr_dtor(&iteriter); - zval_dtor(&regexiter); + zval_ptr_dtor(&regexiter); zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname); RETURN_FALSE; } @@ -2218,7 +2218,7 @@ its_ok: ZVAL_NULL(&ret); if (SUCCESS != object_init_ex(&ret, ce)) { - zval_dtor(&ret); + zval_ptr_dtor(&ret); zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname); return NULL; } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index e57c388..c29c354 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4127,7 +4127,7 @@ ZEND_METHOD(reflection_class, getMethod) /* don't assign closure_object since we only reflect the invoke handler method and not the closure definition itself */ reflection_method_factory(ce, mptr, NULL, return_value); - zval_dtor(&obj_tmp); + zval_ptr_dtor(&obj_tmp); efree(lc_name); } else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lc_name, name_len)) != NULL) { reflection_method_factory(ce, mptr, NULL, return_value); @@ -4571,7 +4571,7 @@ ZEND_METHOD(reflection_class, isCloneable) return; } RETVAL_BOOL(Z_OBJ_HANDLER(obj, clone_obj) != NULL); - zval_dtor(&obj); + zval_ptr_dtor(&obj); } } }

« previous php.cvs (#102419) next »