diff options
author | Yiduo (David) Wang <davidw@php.net> | 2007-10-07 05:15:07 +0000 |
---|---|---|
committer | Yiduo (David) Wang <davidw@php.net> | 2007-10-07 05:15:07 +0000 |
commit | 95da0dc5700ee9d41f1e5664c8167cd37023dbd3 (patch) | |
tree | e4c6288af1a3f260bbd705c83c397741233d60ea /ext/pcre/php_pcre.c | |
parent | d20f6ecac8e2db5b0595c4fdef4cae221594ab88 (diff) | |
download | php-git-95da0dc5700ee9d41f1e5664c8167cd37023dbd3.tar.gz |
Added macros for managing zval refcounts and is_ref statuses
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 55974c7e73..5fcf7e64d5 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -845,13 +845,13 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_uchar utype, char *s zend_string_to_unicode_ex(UG(utf8_conv), &u, &u_len, subpat_names[i], strlen(subpat_names[i]), &status); zend_u_hash_update(Z_ARRVAL_P(subpats), IS_UNICODE, ZSTR(u), u_len+1, &match_sets[i], sizeof(zval *), NULL); - ZVAL_ADDREF(match_sets[i]); + Z_ADDREF_P(match_sets[i]); efree(u); status = U_ZERO_ERROR; } else { zend_hash_update(Z_ARRVAL_P(subpats), subpat_names[i], strlen(subpat_names[i])+1, &match_sets[i], sizeof(zval *), NULL); - ZVAL_ADDREF(match_sets[i]); + Z_ADDREF_P(match_sets[i]); } } zend_hash_next_index_insert(Z_ARRVAL_P(subpats), &match_sets[i], sizeof(zval *), NULL); @@ -1961,7 +1961,7 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return /* If the entry fits our requirements */ if ((count > 0 && !invert) || (count == PCRE_ERROR_NOMATCH && invert)) { - (*entry)->refcount++; + Z_ADDREF_PP(entry); /* Add to return array */ switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(input), &string_key, &string_key_len, &num_key, 0, NULL)) |