summaryrefslogtreecommitdiff
path: root/src/spellfile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-29 23:04:25 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-29 23:04:25 +0100
commit1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506 (patch)
tree8f5dc27f3eeea927ad3ca8de42fe0df06a041dd5 /src/spellfile.c
parent257a396879ff67a0482841a39237f30a8e1e27c5 (diff)
downloadvim-git-1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506.tar.gz
patch 8.2.0056: execution stack is incomplete and inefficientv8.2.0056
Problem: Execution stack is incomplete and inefficient. Solution: Introduce a proper execution stack and use it instead of sourcing_name/sourcing_lnum. Create a string only when used.
Diffstat (limited to 'src/spellfile.c')
-rw-r--r--src/spellfile.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/spellfile.c b/src/spellfile.c
index b9451ecd6..6cad202fd 100644
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -349,8 +349,6 @@ spell_load_file(
int i;
int n;
int len;
- char_u *save_sourcing_name = sourcing_name;
- linenr_T save_sourcing_lnum = sourcing_lnum;
slang_T *lp = NULL;
int c = 0;
int res;
@@ -393,8 +391,7 @@ spell_load_file(
lp = old_lp;
// Set sourcing_name, so that error messages mention the file name.
- sourcing_name = fname;
- sourcing_lnum = 0;
+ estack_push(ETYPE_SPELL, fname, 0);
/*
* <HEADER>: <fileID>
@@ -581,8 +578,7 @@ endFAIL:
endOK:
if (fd != NULL)
fclose(fd);
- sourcing_name = save_sourcing_name;
- sourcing_lnum = save_sourcing_lnum;
+ estack_pop();
return lp;
}