This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Add assert
authorKarl Williamson <khw@cpan.org>
Tue, 28 Apr 2020 16:27:01 +0000 (10:27 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 29 Apr 2020 19:21:51 +0000 (13:21 -0600)
The code's proper functioning currently depends on bracketed character
classes not returning a sequence of characters to the regex sets feature
(?[...])

Add an assert to validate that.

regcomp.c

index 8e109b5..1c45413 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -17371,6 +17371,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
     PERL_UNUSED_ARG(depth);
 #endif
 
+    assert(! (ret_invlist && allow_mutiple_chars));
 
     /* If wants an inversion list returned, we can't optimize to something
      * else. */