com php-src: Removed redundand code: ext/pcre/php_pcre.c
| From: | Dmitry Stogov | Date: | Thu, 19 Jul 2018 12:47:15 +0000 |
| Subject: | com php-src: Removed redundand code: ext/pcre/php_pcre.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-102613@lists.php.net to get a copy of this message | ||
Commit: 5be44312f80dd07b0a9ede1a175ac08f8cfdbd6a
Author: Dmitry Stogov <dmitry@zend.com> Thu, 19 Jul 2018 15:47:15 +0300
Parents: 54ebebd686255c5f124af718c966edb392782d4a
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5be44312f80dd07b0a9ede1a175ac08f8cfdbd6a
Log:
Removed redundand code
Changed paths:
M ext/pcre/php_pcre.c
Diff:
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 2f12fcf..e438db3 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1535,7 +1535,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string
*su
uint32_t options; /* Execution options */
int count; /* Count of matched subpatterns */
PCRE2_SIZE *offsets; /* Array of subpattern offsets */
- char **subpat_names; /* Array for named subpatterns */
uint32_t num_subpats; /* Number of captured subpatterns */
size_t new_len; /* Length of needed storage */
size_t alloc_len; /* Actual allocated length */
@@ -1554,19 +1553,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string
*su
/* Calculate the size of the offsets array, and allocate memory for it. */
num_subpats = pce->capture_count + 1;
-
- /*
- * Build a mapping from subpattern numbers to their names. We will
- * allocate the table only if there are any named subpatterns.
- */
- subpat_names = NULL;
- if (UNEXPECTED(pce->name_count > 0)) {
- subpat_names = make_subpats_table(num_subpats, pce);
- if (!subpat_names) {
- return NULL;
- }
- }
-
alloc_len = 0;
result = NULL;
@@ -1582,9 +1568,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string
*su
match_data = pcre2_match_data_create_from_pattern(pce->re, gctx);
if (!match_data) {
PCRE_G(error_code) = PHP_PCRE_INTERNAL_ERROR;
- if (subpat_names) {
- efree(subpat_names);
- }
return NULL;
}
}
@@ -1785,10 +1768,6 @@ error:
pcre2_match_data_free(match_data);
}
- if (UNEXPECTED(subpat_names)) {
- efree(subpat_names);
- }
-
return result;
}
/* }}} */