summaryrefslogtreecommitdiffstats
path: root/generic/regc_nfa.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-02-08 01:44:17 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-02-08 01:44:17 (GMT)
commit3c8b0820ea8c617e68e7f455a5d62b237f16bb2c (patch)
treecea2c1c0dc09b070dfb1811e3b66647c00ca21b4 /generic/regc_nfa.c
parent78fd03de10e26eef255074fab73cc2f016a70db2 (diff)
downloadtcl-3c8b0820ea8c617e68e7f455a5d62b237f16bb2c.zip
tcl-3c8b0820ea8c617e68e7f455a5d62b237f16bb2c.tar.gz
tcl-3c8b0820ea8c617e68e7f455a5d62b237f16bb2c.tar.bz2
[3603557]: Increase the maximum depth of recursion used when duplicating an
automaton in response to encountering a "wild" RE that hit the previous limit. Allow the limit (DUPTRAVERSE_MAX_DEPTH) to be set by defining its value in the Makefile. Problem reported by Jonathan Mills.
Diffstat (limited to 'generic/regc_nfa.c')
-rw-r--r--generic/regc_nfa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c
index 4fb3ea6..2c2397f 100644
--- a/generic/regc_nfa.c
+++ b/generic/regc_nfa.c
@@ -759,7 +759,9 @@ duptraverse(
* Arbitrary depth limit. Needs tuning, but this value is sufficient to
* make all normal tests (not reg-33.14) pass.
*/
-#define DUPTRAVERSE_MAX_DEPTH 500
+#ifndef DUPTRAVERSE_MAX_DEPTH
+#define DUPTRAVERSE_MAX_DEPTH 700
+#endif
if (depth++ > DUPTRAVERSE_MAX_DEPTH) {
NERR(REG_ESPACE);