Skip to content

Commit

Permalink
PATCH: [perl #131598]
Browse files Browse the repository at this point in the history
The cause of this is that the vFAIL macro uses RExC_parse, and that
variable has just been changed in preparation for code after the vFAIL.
The solution is to not change RExC_parse until after the vFAIL.

This is a case where the macro hides stuff that can bite you.
  • Loading branch information
khwilliamson authored and steve-m-hay committed Sep 10, 2017
1 parent 96c83ed commit 2be4ede
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -12196,14 +12196,16 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
}
sv_catpv(substitute_parse, ")");

RExC_parse = RExC_start = RExC_adjusted_start = SvPV(substitute_parse,
len);
len = SvCUR(substitute_parse);

/* Don't allow empty number */
if (len < (STRLEN) 8) {
RExC_parse = endbrace;
vFAIL("Invalid hexadecimal number in \\N{U+...}");
}

RExC_parse = RExC_start = RExC_adjusted_start
= SvPV_nolen(substitute_parse);
RExC_end = RExC_parse + len;

/* The values are Unicode, and therefore not subject to recoding, but
Expand Down

0 comments on commit 2be4ede

Please sign in to comment.