Skip to content

Commit

Permalink
Mark pso_list const (#379)
Browse files Browse the repository at this point in the history
List isn't modified in the code and belongs to read only section and not read write as it was.
  • Loading branch information
TheEragon authored Feb 9, 2024
1 parent 061de31 commit cb22012
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pcre2_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ typedef struct pso {

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

static pso pso_list[] = {
static const pso pso_list[] = {
{ (uint8_t *)STRING_UTFn_RIGHTPAR, PSO_OPT, PCRE2_UTF },
{ (uint8_t *)STRING_UTF_RIGHTPAR, 4, PSO_OPT, PCRE2_UTF },
{ (uint8_t *)STRING_UCP_RIGHTPAR, 4, PSO_OPT, PCRE2_UCP },
Expand Down Expand Up @@ -10312,7 +10312,7 @@ if ((options & PCRE2_LITERAL) == 0)
for (i = 0; i < sizeof(pso_list)/sizeof(pso); i++)
{
uint32_t c, pp;
pso *p = pso_list + i;
const pso *p = pso_list + i;

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

0 comments on commit cb22012

Please sign in to comment.