summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-09-19 10:02:24 -0600
committerKarl Williamson <khw@cpan.org>2018-09-20 08:30:45 -0600
commit94b1fc235db3d15b93f78567e32ea87641156e25 (patch)
treee851fc22d1ddd47d9c514765219ebc979560c128
parentbb0fd582c95534a9ca32b229a3d48714b0dee852 (diff)
downloadperl-94b1fc235db3d15b93f78567e32ea87641156e25.tar.gz
Don't overallocate space for /[foo]/
The ANYOF regnode type (generated by bracketed character classes and \p{}) was allocating too much space because the argument field was being counted twice
-rw-r--r--regcomp.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/regcomp.h b/regcomp.h
index 1e82933233..ea3a0661d9 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -690,8 +690,10 @@ struct regnode_ssc {
#define ANYOF_BITMAP_CLEARALL(p) \
Zero (ANYOF_BITMAP(p), ANYOF_BITMAP_SIZE)
-#define ANYOF_SKIP EXTRA_SIZE(regnode_charclass)
-#define ANYOF_POSIXL_SKIP EXTRA_SIZE(regnode_charclass_posixl)
+#define ANYOF_SKIP (EXTRA_SIZE(regnode_charclass) \
+ - EXTRA_SIZE(struct regnode_1))
+#define ANYOF_POSIXL_SKIP (EXTRA_SIZE(regnode_charclass_posixl) \
+ - EXTRA_SIZE(struct regnode_1))
/*
* Utility definitions.