This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Turn test into an assertion
authorKarl Williamson <public@khwilliamson.com>
Thu, 4 Oct 2012 17:01:57 +0000 (11:01 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 9 Oct 2012 17:16:05 +0000 (11:16 -0600)
Commit 31c15ce5372b770c3ca899df6cf102f1ed6866ba should have made it so
that the situation of a quantifier {m,n} with m>n never happens.  Remove
the check for it, but replace it with an assertion.

regexec.c

index 89da115..6438526 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -5552,8 +5552,7 @@ NULL
            * of the quantifier and the EXACT-like node.  -- japhy
            */
 
-           if (ST.min > ST.max) /* XXX make this a compile-time check? */
-               sayNO;
+           assert(ST.min <= ST.max);
            if (HAS_TEXT(next) || JUMPABLE(next)) {
                U8 *s;
                regnode *text_node = next;