This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Don't doubly do 'use encoding'
authorKarl Williamson <khw@cpan.org>
Fri, 5 Sep 2014 16:15:09 +0000 (10:15 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 7 Sep 2014 03:44:49 +0000 (21:44 -0600)
When reparsing, values have already been converted (if necessary) to
native, so don't do it again.

regcomp.c

index ba51612..726a655 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -14370,6 +14370,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
        RExC_parse = SvPV(substitute_parse, len);
        RExC_end = RExC_parse + len;
         RExC_in_multi_char_class = 1;
+       RExC_override_recoding = 1;
         RExC_emit = (regnode *)orig_emit;
 
        ret = reg(pRExC_state, 1, &reg_flags, depth+1);
@@ -14379,6 +14380,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
        RExC_parse = save_parse;
        RExC_end = save_end;
        RExC_in_multi_char_class = 0;
+       RExC_override_recoding = 0;
         SvREFCNT_dec_NN(multi_char_matches);
         return ret;
     }