re_intuit_start(): make assert unconditional
authorDavid Mitchell <davem@iabyn.com>
Fri, 7 Feb 2014 14:58:06 +0000 (14:58 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 8 Feb 2014 14:04:50 +0000 (14:04 +0000)
an assert was originally in the float-then-anchored branch, but not in the
anchored-then-float branch. When the two branches were merged, the assert
was only done if other==anchored. It turns out the the assert should be
true in both cases, so remove the guard.

I've also changed the condition from

    prog->minlen > other->min_offset
to
    prog->minlen >= other->min_offset

Since they can in fact be equal on a one-char substr with SvTAIL().

regexec.c

index e523ef8..181afe7 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -963,9 +963,7 @@ Perl_re_intuit_start(pTHX_
          * to CHR_SVLEN(must) - !!SvTAIL(must) + prog->float_end_shift
          */
 
-        if (!other_ix)
-            assert(prog->minlen > other->min_offset);
-
+        assert(prog->minlen >= other->min_offset);
         last1 = HOP3c(strend,
                         other->min_offset - prog->minlen, strbeg);