From c1965f58d4dd3970912dcd6a63ccd5860bae1a97 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 5 Jun 2014 16:04:11 +0400 Subject: Use reference counting instead of zval duplication --- ext/zip/php_zip.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'ext/zip/php_zip.c') diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 053cc68058..e73d9c095c 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -2111,7 +2111,7 @@ static ZIPARCHIVE_METHOD(getExternalAttributesName) ZIP_FROM_OBJECT(intern, self); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z/|l", &name, &name_len, &z_opsys, &z_attr, &flags) == FAILURE) { return; } @@ -2128,10 +2128,8 @@ static ZIPARCHIVE_METHOD(getExternalAttributesName) (zip_flags_t)flags, &opsys, &attr) < 0) { RETURN_FALSE; } - ZVAL_DEREF(z_opsys); zval_ptr_dtor(z_opsys); ZVAL_LONG(z_opsys, opsys); - ZVAL_DEREF(z_attr); zval_ptr_dtor(z_attr); ZVAL_LONG(z_attr, attr); RETURN_TRUE; @@ -2155,7 +2153,7 @@ static ZIPARCHIVE_METHOD(getExternalAttributesIndex) ZIP_FROM_OBJECT(intern, self); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzz|l", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz/z/|l", &index, &z_opsys, &z_attr, &flags) == FAILURE) { return; } @@ -2165,10 +2163,8 @@ static ZIPARCHIVE_METHOD(getExternalAttributesIndex) (zip_flags_t)flags, &opsys, &attr) < 0) { RETURN_FALSE; } - ZVAL_DEREF(z_opsys); zval_dtor(z_opsys); ZVAL_LONG(z_opsys, opsys); - ZVAL_DEREF(z_attr); zval_dtor(z_attr); ZVAL_LONG(z_attr, attr); RETURN_TRUE; -- cgit v1.2.1