summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2014-09-28 12:17:37 +0200
committerYves Orton <demerphq@gmail.com>2014-09-28 12:27:50 +0200
commitd9a72fccda5cacaccd2671769c010f3cda59ef8a (patch)
tree433dd30f7414c42503ac1917a7cf4286f30710fe /regcomp.h
parent49f9fecb5d7481850ac2474c72c1013a4c763226 (diff)
downloadperl-d9a72fccda5cacaccd2671769c010f3cda59ef8a.tar.gz
Add tests for a51d618a fix of RT #122283
Add a new re debug mode for outputing stuff useful for testing. In this case we count the number of times that we go through study_chunk. With a51d618a we should do 5 times (or less) when we traverse the test pattern. Without a51d618a we recurse 11 times. In the case of RT #122283 we would do gazilions of recursions, so many I never let it run to finish. / (?(DEFINE)(?<foo>foo)) (?(DEFINE)(?<bar>(?&foo)bar)) (?(DEFINE)(?<baz>(?&bar)baz)) (?(DEFINE)(?<bop>(?&baz)bop)) /x I say "or less" because you could argue that since these defines are never called, we should not actually recurse at all, and should maybe just compile this as a simple empty pattern.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/regcomp.h b/regcomp.h
index d4d3a29545..1d41d6e77f 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -856,6 +856,7 @@ re.pm, especially to the documentation.
#define RE_DEBUG_COMPILE_TRIE 0x000004
#define RE_DEBUG_COMPILE_DUMP 0x000008
#define RE_DEBUG_COMPILE_FLAGS 0x000010
+#define RE_DEBUG_COMPILE_TEST 0x000020
/* Execute */
#define RE_DEBUG_EXECUTE_MASK 0x00FF00
@@ -891,6 +892,8 @@ re.pm, especially to the documentation.
if (re_debug_flags & RE_DEBUG_COMPILE_TRIE) x )
#define DEBUG_FLAGS_r(x) DEBUG_r( \
if (re_debug_flags & RE_DEBUG_COMPILE_FLAGS) x )
+#define DEBUG_TEST_r(x) DEBUG_r( \
+ if (re_debug_flags & RE_DEBUG_COMPILE_TEST) x )
/* Execute */
#define DEBUG_EXECUTE_r(x) DEBUG_r( \
if (re_debug_flags & RE_DEBUG_EXECUTE_MASK) x )