aboutsummaryrefslogtreecommitdiffstats
path: root/lib/regex_internal.c
diff options
context:
space:
mode:
authorPaul Eggert2019-10-11 18:23:47 -0700
committerPaul Eggert2019-10-11 18:24:19 -0700
commit4b60e0722d0a79751f345bd470d07db0d635aa28 (patch)
tree9ebcaa21ec5f08c0caafc7190daf34ed047f8e1f /lib/regex_internal.c
parentf9d8babe6a28b19c781778c361e45b93f7a01f17 (diff)
downloademacs-4b60e0722d0a79751f345bd470d07db0d635aa28.tar.gz
emacs-4b60e0722d0a79751f345bd470d07db0d635aa28.zip
Update from Gnulib
This incorporates: 2019-10-11 Simplify and regularize regex use of ‘assert’ 2019-10-09 regex: omit debug assignment when not debugging 2019-10-09 regex: tell compiler there’s at most 256 arcs out 2019-10-09 regex: simplify by assuming C99 2019-10-09 regex: avoid copying of uninitialized storage 2019-09-29 fbufmode: Fix compilation error on glibc >= 2.28 systems 2019-09-28 Update comments that refer to POSIX 2019-09-23 Update URLs and associated text * doc/misc/texinfo.tex, lib/open.c, lib/regcomp.c: * lib/regex_internal.c, lib/regex_internal.h, lib/regexec.c: * lib/stdio-impl.h: Copy from Gnulib.
Diffstat (limited to 'lib/regex_internal.c')
-rw-r--r--lib/regex_internal.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/regex_internal.c b/lib/regex_internal.c
index 0092cc2a468..4ade0df0b47 100644
--- a/lib/regex_internal.c
+++ b/lib/regex_internal.c
@@ -212,7 +212,7 @@ build_wcs_buffer (re_string_t *pstr)
212{ 212{
213#ifdef _LIBC 213#ifdef _LIBC
214 unsigned char buf[MB_LEN_MAX]; 214 unsigned char buf[MB_LEN_MAX];
215 assert (MB_LEN_MAX >= pstr->mb_cur_max); 215 DEBUG_ASSERT (MB_LEN_MAX >= pstr->mb_cur_max);
216#else 216#else
217 unsigned char buf[64]; 217 unsigned char buf[64];
218#endif 218#endif
@@ -285,7 +285,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
285 size_t mbclen; 285 size_t mbclen;
286#ifdef _LIBC 286#ifdef _LIBC
287 char buf[MB_LEN_MAX]; 287 char buf[MB_LEN_MAX];
288 assert (MB_LEN_MAX >= pstr->mb_cur_max); 288 DEBUG_ASSERT (pstr->mb_cur_max <= MB_LEN_MAX);
289#else 289#else
290 char buf[64]; 290 char buf[64];
291#endif 291#endif
@@ -685,9 +685,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
685 pstr->valid_len - offset); 685 pstr->valid_len - offset);
686 pstr->valid_len -= offset; 686 pstr->valid_len -= offset;
687 pstr->valid_raw_len -= offset; 687 pstr->valid_raw_len -= offset;
688#if defined DEBUG && DEBUG 688 DEBUG_ASSERT (pstr->valid_len > 0);
689 assert (pstr->valid_len > 0);
690#endif
691 } 689 }
692 } 690 }
693 else 691 else
@@ -941,10 +939,7 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags)
941 Idx wc_idx = idx; 939 Idx wc_idx = idx;
942 while(input->wcs[wc_idx] == WEOF) 940 while(input->wcs[wc_idx] == WEOF)
943 { 941 {
944#if defined DEBUG && DEBUG 942 DEBUG_ASSERT (wc_idx >= 0);
945 /* It must not happen. */
946 assert (wc_idx >= 0);
947#endif
948 --wc_idx; 943 --wc_idx;
949 if (wc_idx < 0) 944 if (wc_idx < 0)
950 return input->tip_context; 945 return input->tip_context;