This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Add assertion
authorKarl Williamson <khw@cpan.org>
Mon, 12 Nov 2018 04:54:41 +0000 (21:54 -0700)
committerKarl Williamson <khw@cpan.org>
Fri, 16 Nov 2018 17:31:32 +0000 (10:31 -0700)
regcomp.c

index 871f4e6..b8265a1 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -7536,6 +7536,9 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
         goto redo_parse;
     }
 
+    /* In a stable state, as here, this must be true */
+    assert(RExC_size = RExC_emit + 1);
+
     /* Here, we have successfully parsed and generated the pattern's program
      * for the regex engine.  We are ready to finish things up and look for
      * optimizations. */