diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-07-04 19:22:24 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-07-04 19:22:24 +0300 |
commit | 4a475a4976db92e71949786cdf5990c61514261e (patch) | |
tree | 6934c9e00200e6388256656b8fa71c97a1a3a158 /ext/standard/pack.c | |
parent | d798fd491be77943fb751ad97d85475bf324192c (diff) | |
download | php-git-4a475a4976db92e71949786cdf5990c61514261e.tar.gz |
Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
Diffstat (limited to 'ext/standard/pack.c')
-rw-r--r-- | ext/standard/pack.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 846f404af6..e467cf8954 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -850,7 +850,7 @@ PHP_FUNCTION(unpack) break; #else php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; #endif @@ -870,14 +870,14 @@ PHP_FUNCTION(unpack) default: php_error_docref(NULL, E_WARNING, "Invalid format type %c", type); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; break; } if (size != 0 && size != -1 && size < 0) { php_error_docref(NULL, E_WARNING, "Type %c: integer overflow", type); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } @@ -896,7 +896,7 @@ PHP_FUNCTION(unpack) if (size != 0 && size != -1 && INT_MAX - size + 1 < inputpos) { php_error_docref(NULL, E_WARNING, "Type %c: integer overflow", type); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } @@ -1192,7 +1192,7 @@ PHP_FUNCTION(unpack) break; } else { php_error_docref(NULL, E_WARNING, "Type %c: not enough input, need %d, have " ZEND_LONG_FMT, type, size, inputlen - inputpos); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } } |