This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #124280] don't warn for 'my $foo, *bar'
[perl5.git] / regcomp.c
index a37dc82..da6eb16 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13899,7 +13899,13 @@ redo_curchar:
                 }
 
                 lhs = av_pop(stack);
-                assert(IS_OPERAND(lhs));
+
+                if (! IS_OPERAND(lhs)) {
+
+                    /* This can happen when there is an empty (), like in
+                     * /(?[[0]+()+])/ */
+                    goto bad_syntax;
+                }
 
                 switch (stacked_operator) {
                     case '&':