diff options
author | Karl Williamson <khw@cpan.org> | 2017-08-25 11:33:58 -0600 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2017-09-10 14:13:03 +0100 |
commit | 2692dda97731c37082a0075eff50d741901c665f (patch) | |
tree | 3fc581fda3eb2d0a89c23cf8dc6647f7359331ef | |
parent | 66288bb3f44c8aa5122e5f40d8cfc0eada8b1695 (diff) | |
download | perl-2692dda97731c37082a0075eff50d741901c665f.tar.gz |
PATCH: [perl #131598]
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.
(cherry picked from commit 2be4edede4ae226e2eebd4eff28cedd2041f300f)
-rw-r--r-- | regcomp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -12159,14 +12159,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 |