pp_match(): fix UTF* match setting
authorDavid Mitchell <davem@iabyn.com>
Mon, 17 Jun 2013 16:38:41 +0000 (17:38 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sun, 28 Jul 2013 09:33:35 +0000 (10:33 +0100)
A recent commit did RX_MATCH_UTF8_set() based on the utf8-ness of the
pattern rather than the match string. I didn't matter because in that
branch they were guaranteed to have the same value, but fix it anyway,
both for correctness sake, and because it it *will* matter shortly

pp_hot.c

index 4d7467d..07a7893 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1447,7 +1447,7 @@ PP(pp_match)
             /* match via INTUIT shouldn't have any captures.
              * Let @-, @+, $^N know */
             RX_LASTPAREN(rx) = RX_LASTCLOSEPAREN(rx) = 0;
-            RX_MATCH_UTF8_set(rx, cBOOL(DO_UTF8(rx)));
+            RX_MATCH_UTF8_set(rx, cBOOL(DO_UTF8(TARG)));
             if ( !(r_flags & REXEC_NOT_FIRST) )
                 Perl_reg_set_capture_string(aTHX_ rx,
                                         (char*)truebase, (char *)strend,