aboutsummaryrefslogtreecommitdiff
path: root/posix/regex_internal.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-11-04 16:47:11 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-11-06 09:20:52 -0300
commit2a0356e1191804d57005e1cfe2a72f019b7a8cce (patch)
tree564fe7f761a902ba3babe5dc5662f13b0f628c41 /posix/regex_internal.c
parent4ecd584908109db3ac9bf4aca307ddd44e029275 (diff)
downloadglibc-2a0356e1191804d57005e1cfe2a72f019b7a8cce.zip
glibc-2a0356e1191804d57005e1cfe2a72f019b7a8cce.tar.gz
glibc-2a0356e1191804d57005e1cfe2a72f019b7a8cce.tar.bz2
posix: Sync regex with gnulib
It sync with gnulib commit 6cfb4302b3e1da14d706198b693558290e9b00f4 and contains the fixes: https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=32915b2a8a43825720755113bdffe9f67a591748 https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=48f07576b8cd935b48e1050551f45ab1a79b9f01 https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=5e407aba1f775d51b25481cb55f324c9868f62d7 https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4e02b30c761c76d04057fa5f6bba71401f9310cd https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=79f8ee4e389f8cb1339f8abed9a7d29816e2a2d4 Checked on x86_64-linux-gnu and i686-linux-gnu.
Diffstat (limited to 'posix/regex_internal.c')
-rw-r--r--posix/regex_internal.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index 99fbb26..6aa9116 100644
--- a/posix/regex_internal.c
+++ b/posix/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;