This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Add a panic for code that shouldn't happen
authorKarl Williamson <khw@cpan.org>
Sun, 20 Sep 2015 02:16:46 +0000 (20:16 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 11 Oct 2015 16:48:31 +0000 (10:48 -0600)
It's better to quit than to blindly continue after failure.

regcomp.c

index d9d4222..5233499 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -10410,7 +10410,9 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
                         parno = (I32)uv;
                         RExC_parse = (char*)endptr;
                     }
-                    /* XXX else what? */
+                    else {
+                        vFAIL("panic: grok_atoUV returned FALSE");
+                    }
                     ret = reganode(pRExC_state, GROUPP, parno);
 
                  insert_if_check_paren: