summaryrefslogtreecommitdiff
path: root/m4/regex.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/regex.m4')
-rw-r--r--m4/regex.m413
1 files changed, 12 insertions, 1 deletions
diff --git a/m4/regex.m4 b/m4/regex.m4
index 055d71b..3a39b1a 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,4 +1,4 @@
-# serial 67
+# serial 68
# Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc.
#
@@ -213,6 +213,17 @@ AC_DEFUN([gl_REGEX],
if (! REG_STARTEND)
result |= 64;
+ /* Matching with the compiled form of this regexp would provoke
+ an assertion failure prior to glibc-2.28:
+ regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+ With glibc-2.28, compilation fails and reports the invalid
+ back reference. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("0|()0|\\1|0", 10, &regex);
+ if (!s || strcmp (s, "Invalid back reference"))
+ result |= 64;
+
#if 0
/* It would be nice to reject hosts whose regoff_t values are too
narrow (including glibc on hosts with 64-bit ptrdiff_t and