aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-05-17 20:29:52 +0000
committerKarl Heuer1995-05-17 20:29:52 +0000
commit809a2f57c2e685ec6cf227a43c9e22637f3a3b5c (patch)
treefcc850e97e3469cbaf582fbcf5139c68e16d4aab /src
parent907d219043e00da9dbcd59abb23fe7e78a2f4bde (diff)
downloademacs-809a2f57c2e685ec6cf227a43c9e22637f3a3b5c.tar.gz
emacs-809a2f57c2e685ec6cf227a43c9e22637f3a3b5c.zip
(re_compile_fastmap): Undo previous change.
(RESET_FAIL_STACK): New macro. (re_compile_fastmap): Use RESET_FAIL_STACK, not REGEX_FREE_STACK directly.
Diffstat (limited to 'src')
-rw-r--r--src/regex.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/regex.c b/src/regex.c
index 74fca1cbbae..a3f601bcae5 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1011,7 +1011,8 @@ typedef struct
1011#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) 1011#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
1012 1012
1013 1013
1014/* Initialize `fail_stack'. Do `return -2' if the alloc fails. */ 1014/* Define macros to initialize and free the failure stack.
1015 Do `return -2' if the alloc fails. */
1015 1016
1016#ifdef MATCH_MAY_ALLOCATE 1017#ifdef MATCH_MAY_ALLOCATE
1017#define INIT_FAIL_STACK() \ 1018#define INIT_FAIL_STACK() \
@@ -1025,11 +1026,15 @@ typedef struct
1025 fail_stack.size = INIT_FAILURE_ALLOC; \ 1026 fail_stack.size = INIT_FAILURE_ALLOC; \
1026 fail_stack.avail = 0; \ 1027 fail_stack.avail = 0; \
1027 } while (0) 1028 } while (0)
1029
1030#define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
1028#else 1031#else
1029#define INIT_FAIL_STACK() \ 1032#define INIT_FAIL_STACK() \
1030 do { \ 1033 do { \
1031 fail_stack.avail = 0; \ 1034 fail_stack.avail = 0; \
1032 } while (0) 1035 } while (0)
1036
1037#define RESET_FAIL_STACK()
1033#endif 1038#endif
1034 1039
1035 1040
@@ -3080,7 +3085,7 @@ re_compile_fastmap (bufp)
3080 { 3085 {
3081 if (!PUSH_PATTERN_OP (p + j, fail_stack)) 3086 if (!PUSH_PATTERN_OP (p + j, fail_stack))
3082 { 3087 {
3083 REGEX_FREE_STACK (fail_stack.stack); 3088 RESET_FAIL_STACK ();
3084 return -2; 3089 return -2;
3085 } 3090 }
3086 } 3091 }
@@ -3141,8 +3146,7 @@ re_compile_fastmap (bufp)
3141 bufp->can_be_null |= path_can_be_null; 3146 bufp->can_be_null |= path_can_be_null;
3142 3147
3143 done: 3148 done:
3144 if (!FAIL_STACK_EMPTY ()) 3149 RESET_FAIL_STACK ();
3145 REGEX_FREE_STACK (fail_stack.stack);
3146 return 0; 3150 return 0;
3147} /* re_compile_fastmap */ 3151} /* re_compile_fastmap */
3148 3152