[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new snapshot available: grep-3.1.46-504af
From: |
Bruno Haible |
Subject: |
Re: new snapshot available: grep-3.1.46-504af |
Date: |
Sat, 15 Dec 2018 23:08:08 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-138-generic; KDE/5.18.0; x86_64; ; ) |
Hi Jim,
> > I guess the fix should be to detect the glibc bug in m4/regex.m4 ?
>
> Exactly. That's what I'm doing now.
> I'm expecting to insert something like this, probably reusing the
> result value of "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 (®ex, 0, sizeof regex);
> s = re_compile_pattern ("0|()0|\\1|0", 10, ®ex);
> if (!s || strcmp (s, "Invalid back reference"))
> result |= 64;
>
Looks good to me (modulo the line breaks that are probably caused
by your MUA).
Yes, we have to reuse some of the bits, because a program's return
code (> 0, < 126) has only room for 7 bits.
This test should also be added to tests/test-regex.c, so that we
verify that the choices made by regex.m4 have really achieved their
objective.
Bruno
- Re: new snapshot available: grep-3.1.46-504af,
Bruno Haible <=