Skip to content

Commit cb22012

Browse files
authored
Mark pso_list const (#379)
List isn't modified in the code and belongs to read only section and not read write as it was.
1 parent 061de31 commit cb22012

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pcre2_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ typedef struct pso {
833833

834834
/* NB: STRING_UTFn_RIGHTPAR contains the length as well */
835835

836-
static pso pso_list[] = {
836+
static const pso pso_list[] = {
837837
{ (uint8_t *)STRING_UTFn_RIGHTPAR, PSO_OPT, PCRE2_UTF },
838838
{ (uint8_t *)STRING_UTF_RIGHTPAR, 4, PSO_OPT, PCRE2_UTF },
839839
{ (uint8_t *)STRING_UCP_RIGHTPAR, 4, PSO_OPT, PCRE2_UCP },
@@ -10312,7 +10312,7 @@ if ((options & PCRE2_LITERAL) == 0)
1031210312
for (i = 0; i < sizeof(pso_list)/sizeof(pso); i++)
1031310313
{
1031410314
uint32_t c, pp;
10315-
pso *p = pso_list + i;
10315+
const pso *p = pso_list + i;
1031610316

1031710317
if (patlen - skipatstart - 2 >= p->length &&
1031810318
PRIV(strncmp_c8)(ptr + skipatstart + 2, (char *)(p->name),

0 commit comments

Comments
 (0)