Skip to content

Commit 3cdfe9c

Browse files
committed
Fix PCRE compilation
1 parent 19c00d6 commit 3cdfe9c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ext/pcre/php_pcre.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,12 @@ static zend_string **make_subpats_table(uint32_t num_subpats, pcre_cache_entry *
555555

556556
/* {{{ static calculate_unit_length */
557557
/* Calculates the byte length of the next character. Assumes valid UTF-8 for PCRE2_UTF. */
558-
static zend_always_inline size_t calculate_unit_length(pcre_cache_entry *pce, char *start)
558+
static zend_always_inline size_t calculate_unit_length(pcre_cache_entry *pce, const char *start)
559559
{
560560
size_t unit_len;
561561

562562
if (pce->compile_options & PCRE2_UTF) {
563-
char *end = start;
563+
cpnst char *end = start;
564564

565565
/* skip continuation bytes */
566566
while ((*++end & 0xC0) == 0x80);
@@ -1570,7 +1570,7 @@ static zend_string *preg_do_repl_func(zend_fcall_info *fci, zend_fcall_info_cach
15701570
*/
15711571
PHPAPI zend_string *php_pcre_replace(zend_string *regex,
15721572
zend_string *subject_str,
1573-
char *subject, size_t subject_len,
1573+
const char *subject, size_t subject_len,
15741574
zend_string *replace_str,
15751575
size_t limit, size_t *replace_count)
15761576
{
@@ -1610,10 +1610,10 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
16101610
size_t last_end_offset; /* Where the last search ended */
16111611
char *walkbuf, /* Location of current replacement in the result */
16121612
*walk, /* Used to walk the replacement string */
1613-
*match, /* The current match */
1614-
*piece, /* The current piece of subject */
1615-
*replace_end, /* End of replacement string */
16161613
walk_last; /* Last walked character */
1614+
const char *match, /* The current match */
1615+
*piece, /* The current piece of subject */
1616+
*replace_end; /* End of replacement string */
16171617
size_t result_len; /* Length of result */
16181618
zend_string *result; /* Result of replacement */
16191619
pcre2_match_data *match_data;
@@ -1849,7 +1849,7 @@ static zend_string *php_pcre_replace_func_impl(pcre_cache_entry *pce, zend_strin
18491849
size_t alloc_len; /* Actual allocated length */
18501850
PCRE2_SIZE start_offset; /* Where the new search starts */
18511851
size_t last_end_offset; /* Where the last search ended */
1852-
char *match, /* The current match */
1852+
const char *match, /* The current match */
18531853
*piece; /* The current piece of subject */
18541854
size_t result_len; /* Length of result */
18551855
zend_string *result; /* Result of replacement */

0 commit comments

Comments
 (0)