diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-13 15:49:33 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-08-14 04:29:44 +0800 |
commit | a10a23aae91a8356b36ac63f0917a556cfcaf976 (patch) | |
tree | ea3a4fd393a991badd98b588c5edc64f82dc7c9b /src/nvim/spellfile.c | |
parent | 3a8b8591477b4802af73436e93bd1283d4bab518 (diff) | |
download | rneovim-a10a23aae91a8356b36ac63f0917a556cfcaf976.tar.gz rneovim-a10a23aae91a8356b36ac63f0917a556cfcaf976.tar.bz2 rneovim-a10a23aae91a8356b36ac63f0917a556cfcaf976.zip |
vim-patch:8.2.0097: crash with autocommand and spellfile
Problem: Crash with autocommand and spellfile. (Tim Pope)
Solution: Do not pop exestack when not pushed. (closes vim/vim#5450)
https://github.com/vim/vim/commit/ce6db0273f2c4359f48d75103a42991aa481f14e
Diffstat (limited to 'src/nvim/spellfile.c')
-rw-r--r-- | src/nvim/spellfile.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index 0e66b952da..58a66f0635 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -580,6 +580,7 @@ slang_T *spell_load_file(char_u *fname, char_u *lang, slang_T *old_lp, bool sile slang_T *lp = NULL; int c = 0; int res; + bool did_estack_push = false; fd = os_fopen((char *)fname, "r"); if (fd == NULL) { @@ -612,6 +613,7 @@ slang_T *spell_load_file(char_u *fname, char_u *lang, slang_T *old_lp, bool sile // Set sourcing_name, so that error messages mention the file name. estack_push(ETYPE_SPELL, (char *)fname, 0); + did_estack_push = true; // <HEADER>: <fileID> const int scms_ret = spell_check_magic_string(fd); @@ -807,7 +809,9 @@ endOK: if (fd != NULL) { fclose(fd); } - estack_pop(); + if (did_estack_push) { + estack_pop(); + } return lp; } |