summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regcomp.c6
-rw-r--r--regcomp.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 59b2712e48..1cc3a984e1 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -3888,6 +3888,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
}
if (need_class) {
+ ANYOF_FLAGS(ret) |= ANYOF_LARGE;
if (SIZE_ONLY)
RExC_size += ANYOF_CLASS_ADD_SKIP;
else
@@ -4218,7 +4219,10 @@ S_dumpuntil(pTHX_ regnode *start, regnode *node, regnode *last, SV* sv, I32 l)
node = dumpuntil(start, NEXTOPER(node), NEXTOPER(node) + 1, sv, l + 1);
}
else if (op == ANYOF) {
- node = next;
+ /* arglen 1 + class block */
+ node += 1 + ((ANYOF_FLAGS(node) & ANYOF_LARGE)
+ ? ANYOF_CLASS_SKIP : ANYOF_SKIP);
+ node = NEXTOPER(node);
}
else if (PL_regkind[(U8)op] == EXACT) {
/* Literal string, where present. */
diff --git a/regcomp.h b/regcomp.h
index ee9be39f71..122bec4668 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -194,6 +194,9 @@ struct regnode_charclass_class {
#define ANYOF_UNICODE 0x20
#define ANYOF_UNICODE_ALL 0x40 /* Can match any char past 0xff */
+/* size of node is large (includes class pointer) */
+#define ANYOF_LARGE 0x80
+
/* Are there any runtime flags on in this node? */
#define ANYOF_RUNTIME(s) (ANYOF_FLAGS(s) & 0x0f)