This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revision to hvds patch for #17775
authorKarl Williamson <khw@cpan.org>
Tue, 12 May 2020 17:45:29 +0000 (11:45 -0600)
committerSawyer X <xsawyerx@cpan.org>
Mon, 25 May 2020 07:17:52 +0000 (10:17 +0300)
regcomp.c

index 4e9f322..8505f6d 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -12480,7 +12480,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp, U32 depth)
  *
  * Implements the concatenation operator.
  *
- * On success, returns the offset at which any next node should be placed into
+ * On success, XXX wrong: returns the offset at which any next node should be placed into
  * the regex engine program being compiled.
  *
  * Returns 0 otherwise, setting flagp to RESTART_PARSE if the parse needs
@@ -16464,7 +16464,10 @@ redo_curchar:
                            /* If more than a single node returned, the nested
                             * parens evaluated to more than just a (?[...]),
                             * which isn't legal */
-                        || node != 1) {
+                        || RExC_emit != orig_emit
+                                      + NODE_STEP_REGNODE
+                                      + regarglen[REGEX_SET])
+                    {
                         vFAIL("Expecting interpolated extended charclass");
                     }
                     resultant_invlist = (SV *) ARGp(REGNODE_p(node));