This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Defer setting regnode operand
[perl5.git] / regcomp.c
index 36c59c9..290f8b4 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -18025,10 +18025,6 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
 
     /****** !SIZE_ONLY (Pass 2) AFTER HERE *********/
 
-    if (posixl) {
-        ANYOF_POSIXL_SET_TO_BITMAP(REGNODE_p(ret), posixl);
-    }
-
     /* If folding, we calculate all characters that could fold to or from the
      * ones already on the list */
     if (cp_foldable_list) {
@@ -18724,6 +18720,10 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
 
     populate_ANYOF_from_invlist(REGNODE_p(ret), &cp_list);
 
+    if (posixl) {
+        ANYOF_POSIXL_SET_TO_BITMAP(REGNODE_p(ret), posixl);
+    }
+
     if (invert) {
         ANYOF_FLAGS(REGNODE_p(ret)) |= ANYOF_INVERT;
     }