This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix the trie part of rt-78356
authorYves Orton <demerphq@gmail.com>
Tue, 2 Nov 2010 13:24:20 +0000 (14:24 +0100)
committerYves Orton <demerphq@gmail.com>
Wed, 3 Nov 2010 09:24:41 +0000 (10:24 +0100)
When the jump code was added the case of an empty string followed
by a jump wasnt accounted for. One could argue it should not happen
however that is a matter for a different commit.

regexec.c
t/re/re_tests

index 2e15b45..7e479a3 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -3223,7 +3223,8 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
                                          "%*s  %smatched empty string...%s\n",
                                          REPORT_CODE_OFF+depth*2, "", PL_colors[4], PL_colors[5])
                         );
-                       break;
+                       if (!trie->jump)
+                           break;
                    } else {
                        DEBUG_EXECUTE_r(
                             PerlIO_printf(Perl_debug_log,
index 1c45583..66a47cc 100644 (file)
@@ -1482,4 +1482,5 @@ abc\N{def -       c       -       \\N{NAME} must be resolved by the lexer
 [\0005]        5\000   y       $&      5
 [\_]   _       y       $&      _
 
+(?:(?:)foo|bar|zot|rt78356)    foo     y       $&      foo
 # vim: softtabstop=0 noexpandtab