diff options
| author | Eli Zaretskii | 2020-05-24 18:01:45 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-05-24 18:01:45 +0300 |
| commit | 0195809bb652df1e11f8768860e954b6c4398dee (patch) | |
| tree | c8ec74b16ed55cd89a65a469361edebf9dc96a71 /lib-src | |
| parent | cddb0079ff48fb839be742b157b709d1f1649709 (diff) | |
| download | emacs-0195809bb652df1e11f8768860e954b6c4398dee.tar.gz emacs-0195809bb652df1e11f8768860e954b6c4398dee.zip | |
Fix rare assertion violations in 'etags'
* lib-src/etags.c (pfnote): Instead of raising an assertion when
we get an empty tag name, return immediately. (Bug#41465)
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6: Adapt to latest changes in
etags.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 174c33a7a5f..8babe926db1 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -1984,8 +1984,11 @@ pfnote (char *name, bool is_func, char *linestart, ptrdiff_t linelen, | |||
| 1984 | { | 1984 | { |
| 1985 | register node *np; | 1985 | register node *np; |
| 1986 | 1986 | ||
| 1987 | assert (name == NULL || name[0] != '\0'); | 1987 | if ((CTAGS && name == NULL) |
| 1988 | if (CTAGS && name == NULL) | 1988 | /* We used to have an assertion here for the case below, but if we hit |
| 1989 | that case, it just means our parser got confused, and there's nothing | ||
| 1990 | to do about such empty "tags". */ | ||
| 1991 | || (!CTAGS && name && name[0] == '\0')) | ||
| 1989 | return; | 1992 | return; |
| 1990 | 1993 | ||
| 1991 | np = xnew (1, node); | 1994 | np = xnew (1, node); |