aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/regex.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/regex.c b/src/regex.c
index 7128c4e87c1..e6d04a57df5 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1004,7 +1004,7 @@ static const char *re_error_msgid[] =
1004#endif 1004#endif
1005 1005
1006/* Roughly the maximum number of failure points on the stack. Would be 1006/* Roughly the maximum number of failure points on the stack. Would be
1007 exactly that if always used MAX_FAILURE_SPACE each time we failed. 1007 exactly that if always used MAX_FAILURE_ITEMS items each time we failed.
1008 This is a variable only so users of regex can assign to it; we never 1008 This is a variable only so users of regex can assign to it; we never
1009 change it ourselves. */ 1009 change it ourselves. */
1010#if defined (MATCH_MAY_ALLOCATE) 1010#if defined (MATCH_MAY_ALLOCATE)
@@ -1221,7 +1221,10 @@ typedef struct
1221#endif 1221#endif
1222 1222
1223/* We push at most this many items on the stack. */ 1223/* We push at most this many items on the stack. */
1224#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS) 1224/* We used to use (num_regs - 1), which is the number of registers
1225 this regexp will save; but that was changed to 5
1226 to avoid stack overflow for a regexp with lots of parens. */
1227#define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
1225 1228
1226/* We actually push this many items. */ 1229/* We actually push this many items. */
1227#define NUM_FAILURE_ITEMS \ 1230#define NUM_FAILURE_ITEMS \