summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-05 16:47:06 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-05 16:47:06 +0000
commitb9ad30b40cf004f5ea6fd7a945a950cf873aed7b (patch)
treecce3531a601494f58ec6bc8c9e674dfeea2fad51 /regcomp.c
parente2560c3357339d22d0d9ac926b8e57ce241c1fb6 (diff)
downloadperl-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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index b71e54620c..a7b1cf6fdb 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -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();