@@ -1535,7 +1535,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
1535
1535
uint32_t options ; /* Execution options */
1536
1536
int count ; /* Count of matched subpatterns */
1537
1537
PCRE2_SIZE * offsets ; /* Array of subpattern offsets */
1538
- char * * subpat_names ; /* Array for named subpatterns */
1539
1538
uint32_t num_subpats ; /* Number of captured subpatterns */
1540
1539
size_t new_len ; /* Length of needed storage */
1541
1540
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
1554
1553
1555
1554
/* Calculate the size of the offsets array, and allocate memory for it. */
1556
1555
num_subpats = pce -> capture_count + 1 ;
1557
-
1558
- /*
1559
- * Build a mapping from subpattern numbers to their names. We will
1560
- * allocate the table only if there are any named subpatterns.
1561
- */
1562
- subpat_names = NULL ;
1563
- if (UNEXPECTED (pce -> name_count > 0 )) {
1564
- subpat_names = make_subpats_table (num_subpats , pce );
1565
- if (!subpat_names ) {
1566
- return NULL ;
1567
- }
1568
- }
1569
-
1570
1556
alloc_len = 0 ;
1571
1557
result = NULL ;
1572
1558
@@ -1582,9 +1568,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
1582
1568
match_data = pcre2_match_data_create_from_pattern (pce -> re , gctx );
1583
1569
if (!match_data ) {
1584
1570
PCRE_G (error_code ) = PHP_PCRE_INTERNAL_ERROR ;
1585
- if (subpat_names ) {
1586
- efree (subpat_names );
1587
- }
1588
1571
return NULL ;
1589
1572
}
1590
1573
}
@@ -1785,10 +1768,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
1785
1768
pcre2_match_data_free (match_data );
1786
1769
}
1787
1770
1788
- if (UNEXPECTED (subpat_names )) {
1789
- efree (subpat_names );
1790
- }
1791
-
1792
1771
return result ;
1793
1772
}
1794
1773
/* }}} */
0 commit comments