inputs. This was fixed in Perl 5.23.4, but the improvement was not
noticed until after that was released, so is included here now.
+=item *
+
+Certain syntax errors in
+L<perlrecharclass/Extended Bracketed Character Classes> caused panics
+instead of the proper error message. This has now been fixed. [perl
+#126481]
+
=back
=head1 Known Problems
av_push(stack, rhs);
goto redo_curchar;
- case '!': /* Highest priority, right associative, so just push
- onto stack */
- av_push(stack, newSVuv(curchar));
+ case '!': /* Highest priority, right associative */
+
+ /* If what's already at the top of the stack is another '!",
+ * they just cancel each other out */
+ if ( (top_ptr = av_fetch(stack, top_index, FALSE))
+ && (IS_OPERATOR(*top_ptr) && SvUV(*top_ptr) == '!'))
+ {
+ only_to_avoid_leaks = av_pop(stack);
+ SvREFCNT_dec(only_to_avoid_leaks);
+ }
+ else { /* Otherwise, since it's right associative, just push
+ onto the stack */
+ av_push(stack, newSVuv(curchar));
+ }
break;
default:
like("\c]", qr/(?[\c]])/, '\c] should match itself');
}
+# RT #126481 !! with syntax error panics
+{
+ fresh_perl_like('no warnings "experimental::regex_sets"; qr/(?[ ! ! (\w])/',
+ qr/^Unmatched \(/, {},
+ 'qr/(?[ ! ! (\w])/ doesnt panic');
+ # The following didn't panic before, but easy to add this here with a
+ # paren between the !!
+ fresh_perl_like('no warnings "experimental::regex_sets";qr/(?[ ! ( ! (\w)])/',
+ qr/^Unmatched \(/, {},
+ 'qr/qr/(?[ ! ( ! (\w)])/');
+}
+
done_testing();
1;