diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-10-11 18:23:47 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-10-11 18:24:19 -0700 |
commit | 4b60e0722d0a79751f345bd470d07db0d635aa28 (patch) | |
tree | 9ebcaa21ec5f08c0caafc7190daf34ed047f8e1f /lib/regex_internal.c | |
parent | f9d8babe6a28b19c781778c361e45b93f7a01f17 (diff) | |
download | emacs-4b60e0722d0a79751f345bd470d07db0d635aa28.tar.gz |
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.c | 13 |
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) { #ifdef _LIBC unsigned char buf[MB_LEN_MAX]; - assert (MB_LEN_MAX >= pstr->mb_cur_max); + DEBUG_ASSERT (MB_LEN_MAX >= pstr->mb_cur_max); #else unsigned char buf[64]; #endif @@ -285,7 +285,7 @@ build_wcs_upper_buffer (re_string_t *pstr) size_t mbclen; #ifdef _LIBC char buf[MB_LEN_MAX]; - assert (MB_LEN_MAX >= pstr->mb_cur_max); + DEBUG_ASSERT (pstr->mb_cur_max <= MB_LEN_MAX); #else char buf[64]; #endif @@ -685,9 +685,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) pstr->valid_len - offset); pstr->valid_len -= offset; pstr->valid_raw_len -= offset; -#if defined DEBUG && DEBUG - assert (pstr->valid_len > 0); -#endif + DEBUG_ASSERT (pstr->valid_len > 0); } } else @@ -941,10 +939,7 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags) Idx wc_idx = idx; while(input->wcs[wc_idx] == WEOF) { -#if defined DEBUG && DEBUG - /* It must not happen. */ - assert (wc_idx >= 0); -#endif + DEBUG_ASSERT (wc_idx >= 0); --wc_idx; if (wc_idx < 0) return input->tip_context; |