From: Hugo van der Sanden Date: Thu, 26 Apr 2001 23:33:38 +0000 (+0100) Subject: Re: [PATCH @9846] dumping ANYOF X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f66b38db5464959528af7812bbc138af1cb39d6;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH @9846] dumping ANYOF Message-Id: <200104262233.XAA22352@crypt.compulink.co.uk> p4raw-id: //depot/perl@9873 --- diff --git a/regcomp.c b/regcomp.c index 59b2712..1cc3a98 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 ee9be39..122bec4 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)