This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
set PL_reg_starttry correctly
authorDavid Mitchell <davem@iabyn.com>
Wed, 23 May 2012 10:39:28 +0000 (11:39 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:32:53 +0000 (13:32 +0100)
PL_reg_starttry is only used for debugging, and S_regtry only set it
within DEBUG_EXECUTE_r; however, its value is also used within
DEBUG_STACK_r. So always set it when debugging, not just when
execute-debugging is enabled.

regexec.c

index 76ad57d..243387f 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -2670,7 +2670,9 @@ S_regtry(pTHX_ regmatch_info *reginfo, char **startpos)
        prog->subbeg = PL_bostr;
        prog->sublen = PL_regeol - PL_bostr; /* strend may have been modified */
     }
-    DEBUG_EXECUTE_r(PL_reg_starttry = *startpos);
+#ifdef DEBUGGING
+    PL_reg_starttry = *startpos;
+#endif
     prog->offs[0].start = *startpos - PL_bostr;
     PL_reginput = *startpos;
     prog->lastparen = 0;