aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-04-21 19:45:27 +0000
committerKarl Heuer1994-04-21 19:45:27 +0000
commit69fdec9e4d007a6ef670984b04c1443089bff69f (patch)
treefb46de20d4910aaf56234b5f7d8ba6e69075ba48 /src
parent501b568d67a5b6abfd93e8fe8ae7bd90bd053571 (diff)
downloademacs-69fdec9e4d007a6ef670984b04c1443089bff69f.tar.gz
emacs-69fdec9e4d007a6ef670984b04c1443089bff69f.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/regex.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/regex.c b/src/regex.c
index 8cabea721b4..5316aaa4eae 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1256,7 +1256,6 @@ typedef union
1256 We make the fail stack a global thing, and then grow it to 1256 We make the fail stack a global thing, and then grow it to
1257 re_max_failures when we compile. */ 1257 re_max_failures when we compile. */
1258#ifndef MATCH_MAY_ALLOCATE 1258#ifndef MATCH_MAY_ALLOCATE
1259static int fail_stack_allocated;
1260static fail_stack_type fail_stack; 1259static fail_stack_type fail_stack;
1261 1260
1262static const char ** regstart, ** regend; 1261static const char ** regstart, ** regend;
@@ -2493,9 +2492,9 @@ regex_compile (pattern, size, syntax, bufp)
2493 /* Since DOUBLE_FAIL_STACK refuses to double only if the current size 2492 /* Since DOUBLE_FAIL_STACK refuses to double only if the current size
2494 is strictly greater than re_max_failures, the largest possible stack 2493 is strictly greater than re_max_failures, the largest possible stack
2495 is 2 * re_max_failures failure points. */ 2494 is 2 * re_max_failures failure points. */
2496 fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS); 2495 if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS))
2497 if (fail_stack.size > fail_stack_allocated)
2498 { 2496 {
2497 fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS);
2499 if (! fail_stack.stack) 2498 if (! fail_stack.stack)
2500 fail_stack.stack = 2499 fail_stack.stack =
2501 (fail_stack_elt_t *) malloc (fail_stack.size 2500 (fail_stack_elt_t *) malloc (fail_stack.size
@@ -2505,7 +2504,6 @@ regex_compile (pattern, size, syntax, bufp)
2505 (fail_stack_elt_t *) realloc (fail_stack.stack, 2504 (fail_stack_elt_t *) realloc (fail_stack.stack,
2506 (fail_stack.size 2505 (fail_stack.size
2507 * sizeof (fail_stack_elt_t))); 2506 * sizeof (fail_stack_elt_t)));
2508 fail_stack_allocated = fail_stack.size;
2509 } 2507 }
2510 2508
2511 /* Initialize some other variables the matcher uses. */ 2509 /* Initialize some other variables the matcher uses. */