summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-11-05 20:28:28 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-11-05 21:23:02 -0800
commitab4e48c10a3551d7cfb88a2e29d82e0b499712e1 (patch)
treedeae0125b6ad656404d9545e0948022a55e2f332 /regexec.c
parent6b6b21da8e7a4aa561c0b61f5a38769acc035b26 (diff)
downloadperl-ab4e48c10a3551d7cfb88a2e29d82e0b499712e1.tar.gz
Manually revert "Rationalise RX_MATCH_UTF8_set()"
Commit 0254aed965 says in its message, among other things: Now that the RXf_MATCH_UTF8 flag on a regex is just used to indicate whether the captures on a successful match are utf8, only set this flag at the end of a successful match, rather than at the start of the match. But if we only set the utf8 flag at the end of the match, then $^N accessed within the match will have the flag wrongly set.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 37018ac048..e74ca18e4c 100644
--- a/regexec.c
+++ b/regexec.c
@@ -703,6 +703,7 @@ Perl_re_intuit_start(pTHX_
goto fail;
}
+ RX_MATCH_UTF8_set(rx,utf8_target);
reginfo->is_utf8_target = cBOOL(utf8_target);
reginfo->info_aux = NULL;
reginfo->strbeg = strbeg;
@@ -2617,6 +2618,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
}
RX_MATCH_TAINTED_off(rx);
+ RX_MATCH_UTF8_set(rx, utf8_target);
reginfo->prog = rx; /* Yes, sorry that this is confusing. */
reginfo->intuit = 0;
@@ -3137,8 +3139,6 @@ got_it:
if (RXp_PAREN_NAMES(prog))
(void)hv_iterinit(RXp_PAREN_NAMES(prog));
- RX_MATCH_UTF8_set(rx, utf8_target);
-
/* make sure $`, $&, $', and $digit will work later */
if ( !(flags & REXEC_NOT_FIRST) )
S_reg_set_capture_string(aTHX_ rx,