This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Change a panic into an assert
authorKarl Williamson <khw@cpan.org>
Tue, 29 Apr 2014 03:08:19 +0000 (21:08 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 30 May 2014 16:33:02 +0000 (10:33 -0600)
This really should never happen, so might as well be an assert.

regcomp.c

index 693d044..233fd88 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -14456,9 +14456,8 @@ parseit:
                         for (k = 0; k <= av_tindex(list); k++) {
                             SV** c_p = av_fetch(list, k, FALSE);
                             UV c;
-                            if (c_p == NULL) {
-                                Perl_croak(aTHX_ "panic: invalid PL_utf8_foldclosures structure");
-                            }
+                            assert(c_p);
+
                             c = SvUV(*c_p);
 
                             /* /aa doesn't allow folds between ASCII and non- */