diff options
author | Yves Orton <demerphq@gmail.com> | 2012-03-19 17:33:22 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2012-03-19 17:33:22 +0100 |
commit | ab79ecc9d7bcb01df86abda790b94ab411e18235 (patch) | |
tree | 9cbf59df50a42cbef3acfc20543ed45a5040c0ee | |
parent | 4c29c902b7533043baba4bb5f8ce1d0b3ba1e260 (diff) | |
download | perl-yves/exactish_with_min_len.tar.gz |
-rw-r--r-- | regcomp.c | 2 | ||||
-rw-r--r-- | regcomp.h | 10 |
2 files changed, 7 insertions, 5 deletions
@@ -2688,7 +2688,7 @@ S_join_exact(pTHX_ RExC_state_t *pRExC_state, regnode *scan, UV *min_subtract, b const unsigned int oldl = STR_LEN(scan); regnode * const nnext = regnext(n); - if (oldl + STR_LEN(n) > U8_MAX) + if (oldl + STR_LEN(n) > EXACT_STR_LEN_MAX) break; DEBUG_PEEP("merg",n,depth); @@ -140,13 +140,15 @@ typedef OP OP_4tree; /* Will be redefined later. */ #define PREGf_CUTGROUP_SEEN 0x00000010 +#define EXACT_STR_LEN U16 +#define EXACT_STR_LEN_MAX U16_MAX /* this is where the old regcomp.h started */ - struct regnode_string { - U8 str_len; + U8 flags; U8 type; U16 next_off; - U8 min_len; + EXACT_STR_LEN str_len; + EXACT_STR_LEN min_len; char string[1]; }; @@ -262,7 +264,7 @@ struct regnode_charclass_class { #define STR_LEN(p) (((struct regnode_string *)p)->str_len) #define MIN_LEN(p) (((struct regnode_string *)p)->min_len) #define STRING(p) (((struct regnode_string *)p)->string) -#define STR_SZ(l) ((l + sizeof(regnode) ) / sizeof(regnode)) +#define STR_SZ(l) ((l + sizeof(regnode) * 2 - 1 ) / sizeof(regnode)) #define NODE_SZ_STR(p) (STR_SZ(STR_LEN(p))+1) #undef NODE_ALIGN |