re_intuit_start(): use different var for tmp value
authorDavid Mitchell <davem@iabyn.com>
Fri, 24 Jan 2014 14:41:56 +0000 (14:41 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 7 Feb 2014 22:39:37 +0000 (22:39 +0000)
Make the anchored branch more similar to the floating branch by using s to
hold the start position for fbm rather than t.  Should be functionally
equivalent.

Note that on failure in the anchored branch, we leave with t holding a
different value than before, but it shouldn't matter, since the value of t
is only used in the success case.

regexec.c

index d658666..26907d3 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -931,9 +931,10 @@ Perl_re_intuit_start(pTHX_
                    NOOP;
                else
                    t = strpos;
-               t = HOP3c(t, prog->anchored_offset, strend);
-               if (t < other_last)     /* These positions already checked */
-                   t = other_last;
+
+               s = HOP3c(t, prog->anchored_offset, strend);
+               if (s < other_last)     /* These positions already checked */
+                   s = other_last;
 
                 assert(prog->minlen > prog->anchored_offset);
                last2 = last1 = HOP3c(strend,
@@ -945,7 +946,7 @@ Perl_re_intuit_start(pTHX_
                must = utf8_target ? prog->anchored_utf8 : prog->anchored_substr;
                 assert(SvPOK(must));
                 s = fbm_instr(
-                    (unsigned char*)t,
+                    (unsigned char*)s,
                     HOP3(last1 + SvCUR(must), -(SvTAIL(must)!=0), strbeg),
                     must,
                     multiline ? FBMrf_MULTILINE : 0