This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #133978] BBC breaks Jcode
authorKarl Williamson <khw@cpan.org>
Wed, 3 Apr 2019 16:25:26 +0000 (10:25 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 3 Apr 2019 16:46:45 +0000 (10:46 -0600)
This turned out to be caused by taking another macro as a template
without understanding the subtleties.  In this case, the variable
'previous_occurrence_end' should be updated only if 'COND' is true.  (In
the template the COND was implicitly true)

regexec.c
t/re/re_tests

index 7309000..ee98c86 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1856,9 +1856,14 @@ STMT_START {
             break;                                          \
         }                                                   \
                                                             \
-        if (COND) FBC_CHECK_AND_TRY                         \
-        s += UTF8SKIP(s);                                   \
-        previous_occurrence_end = s;                        \
+        if (COND) {                                         \
+            FBC_CHECK_AND_TRY                               \
+            s += UTF8SKIP(s);                               \
+            previous_occurrence_end = s;                    \
+        }                                                   \
+        else {                                              \
+            s += UTF8SKIP(s);                               \
+        }                                                   \
     }
 
 /* The three macros below are slightly different versions of the same logic.
index 991cde6..17a5b53 100644 (file)
@@ -2015,6 +2015,7 @@ AB\s+\x{100}      AB \x{100}X     y       -       -
 /\1a(b)/       bab     n       -       -               # This compiles but fails to match as \1 is not set when parsed.
 /(?iu)(?<=\xdf)hbase/  sshbase y       $&      hbase
 /\x{30c3}?[\x{30a2}\x{30a4}\x{30a6}\x{30a8}\x{30aa}-\x{30e2}\x{30e4}\x{30e6}\x{30e8}-\x{30f4}](?:[\x{30e3}\x{30e5}\x{30e7}\x{30a1}\x{30a3}\x{30a5}\x{30a7}\x{30a9}])?\x{30fc}?\x{30f3}?/       \x{30de}\x{30fc}\x{30af}\x{30b5}\x{30fc}\x{30d3}\x{30b9}        y       $&      \x{30de}\x{30fc}        # part of [perl #133942
+/[\x{3041}-\x{3093}]+/ \x{6f22}\x{5b57}\x{3001}\x{30ab}\x{30bf}\x{30ab}\x{30ca}\x{3001}\x{3072}\x{3089}\x{304c}\x{306a}\x{306e}\x{5165}\x{3063}\x{305f}String  y       $&      \x{3072}\x{3089}\x{304c}\x{306a}\x{306e}        # [perl #133978]
 
 # Keep these lines at the end of the file
 # vim: softtabstop=0 noexpandtab