diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-05 16:47:06 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-05 16:47:06 +0000 |
commit | b9ad30b40cf004f5ea6fd7a945a950cf873aed7b (patch) | |
tree | cce3531a601494f58ec6bc8c9e674dfeea2fad51 /regcomp.c | |
parent | e2560c3357339d22d0d9ac926b8e57ce241c1fb6 (diff) | |
download | perl-b9ad30b40cf004f5ea6fd7a945a950cf873aed7b.tar.gz |
Make Perl_pregcomp() use SvUTF8() of the pattern, rather than the flag
bit in pmflags, to decide whether the pattern is UTF-8.
p4raw-id: //depot/perl@32851
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -4151,7 +4151,7 @@ Perl_pregcomp(pTHX_ const SV * const pattern, const U32 flags) #endif REGEXP * -Perl_re_compile(pTHX_ const SV * const pattern, const U32 pm_flags) +Perl_re_compile(pTHX_ const SV * const pattern, U32 pm_flags) { dVAR; REGEXP *rx; @@ -4175,7 +4175,10 @@ Perl_re_compile(pTHX_ const SV * const pattern, const U32 pm_flags) GET_RE_DEBUG_FLAGS_DECL; DEBUG_r(if (!PL_colorset) reginitcolors()); - RExC_utf8 = RExC_orig_utf8 = pm_flags & RXf_UTF8; + RExC_utf8 = RExC_orig_utf8 = SvUTF8(pattern); + assert(!(pm_flags & RXf_UTF8)); + if (RExC_utf8) + pm_flags |= RXf_UTF8; DEBUG_COMPILE_r({ SV *dsv= sv_newmortal(); |