summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-06-05 16:04:11 +0400
committerDmitry Stogov <dmitry@zend.com>2014-06-05 16:04:11 +0400
commitc1965f58d4dd3970912dcd6a63ccd5860bae1a97 (patch)
tree15b4a94e8e8405f791438c468ad4eb03f60c4079 /ext/pcre/php_pcre.c
parent3d87391cc06fe87344536e88ac74ded22b0195cf (diff)
downloadphp-git-c1965f58d4dd3970912dcd6a63ccd5860bae1a97.tar.gz
Use reference counting instead of zval duplication
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 193234c131..0ce3600005 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -542,7 +542,7 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
long flags = 0; /* Match control flags */
long start_offset = 0; /* Where the new search starts */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ss|zll", &regex,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ss|z/ll", &regex,
&subject, &subject_len, &subpats, &flags, &start_offset) == FAILURE) {
RETURN_FALSE;
}
@@ -552,9 +552,6 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
RETURN_FALSE;
}
- if (subpats) {
- ZVAL_DEREF(subpats);
- }
php_pcre_match_impl(pce, subject, subject_len, return_value, subpats,
global, ZEND_NUM_ARGS() >= 4, flags, start_offset TSRMLS_CC);
}
@@ -1355,7 +1352,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
int replace_count=0, old_replace_count;
/* Get function parameters and do error-checking. */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|lz", &regex, &replace, &subject, &limit, &zcount) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|lz/", &regex, &replace, &subject, &limit, &zcount) == FAILURE) {
return;
}
@@ -1419,7 +1416,6 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
}
}
if (ZEND_NUM_ARGS() > 4) {
- ZVAL_DEREF(zcount);
zval_dtor(zcount);
ZVAL_LONG(zcount, replace_count);
}