This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fixup, guard av_top_index() for null RExC_warn_text
authorYves Orton <demerphq@gmail.com>
Fri, 10 Jun 2016 11:34:37 +0000 (13:34 +0200)
committerYves Orton <demerphq@gmail.com>
Fri, 10 Jun 2016 11:34:37 +0000 (13:34 +0200)
regcomp.c

index a62e0b7..86173db 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -14534,8 +14534,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
                 ADD_POSIX_WARNING(p, "there is no terminating ']'");
             }
 
                 ADD_POSIX_WARNING(p, "there is no terminating ']'");
             }
 
-            if (posix_warnings && av_top_index(RExC_warn_text) > -1) {
-                /* warn_text should only be true if posix_warnings is true */
+            if (posix_warnings && RExC_warn_text && av_top_index(RExC_warn_text) > -1) {
                 *posix_warnings = RExC_warn_text;
             }
         }
                 *posix_warnings = RExC_warn_text;
             }
         }