(??{...}) didn't always restore PL_reg_re.
Dave Mitchell [Wed, 5 Apr 2006 03:17:50 +0000 (03:17 +0000)]
Also trie debugging output was using a var that was no longer
valid

p4raw-id: //depot/perl@27717

regexec.c

index 2f6313d..663af09 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -2805,6 +2805,8 @@ S_regmatch(pTHX_ regexp *rex, regnode *prog)
                                best = cur;
                        }
                        DEBUG_EXECUTE_r({
+                           reg_trie_data * const trie = (reg_trie_data*)
+                                           PL_reg_re->data->data[ARG(scan)];
                            SV ** const tmp = av_fetch( trie->words, st->u.trie.accept_buff[ best ].wordnum - 1, 0 );
                            PerlIO_printf( Perl_debug_log, "%*s  %strying alternation #%d <%s> at 0x%p%s\n",
                                REPORT_CODE_OFF+PL_regindent*2, "", PL_colors[4],
@@ -3279,10 +3281,10 @@ S_regmatch(pTHX_ regexp *rex, regnode *prog)
                PL_op = oop;
                PAD_RESTORE_LOCAL(old_comppad);
                PL_curcop = ocurcop;
+               PL_reg_re = oreg;
                if (!st->logical) {
                    /* /(?{...})/ */
                    sv_setsv(save_scalar(PL_replgv), ret);
-                   PL_reg_re = oreg;
                    break;
                }
            }