diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-14 05:18:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-14 05:18:21 +0800 |
commit | 8cd116729fe2a15d62cd10e5ba7d3dcf1f677337 (patch) | |
tree | c3697b80da96e6e1165742979deb121ca491b1d0 /src/nvim/buffer.c | |
parent | c1cbe3fb3d2ec1dbcfdc14ee2d9a5e8049d494ae (diff) | |
parent | 1ca2247639424994890ef70ab34f2bffa23ddd9f (diff) | |
download | rneovim-8cd116729fe2a15d62cd10e5ba7d3dcf1f677337.tar.gz rneovim-8cd116729fe2a15d62cd10e5ba7d3dcf1f677337.tar.bz2 rneovim-8cd116729fe2a15d62cd10e5ba7d3dcf1f677337.zip |
Merge pull request #19752 from zeertzjq/vim-8.2.0056
vim-patch:8.2.{0056,0061,0078,0097,0823}: execution stack
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index be376c2109..6262f2d61c 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -70,6 +70,7 @@ #include "nvim/plines.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" +#include "nvim/runtime.h" #include "nvim/screen.h" #include "nvim/sign.h" #include "nvim/spell.h" @@ -5149,8 +5150,6 @@ static int chk_modeline(linenr_T lnum, int flags) intmax_t vers; int end; int retval = OK; - char *save_sourcing_name; - linenr_T save_sourcing_lnum; prev = -1; for (s = (char *)ml_get(lnum); *s != NUL; s++) { @@ -5195,10 +5194,8 @@ static int chk_modeline(linenr_T lnum, int flags) s = linecopy = xstrdup(s); // copy the line, it will change - save_sourcing_lnum = sourcing_lnum; - save_sourcing_name = sourcing_name; - sourcing_lnum = lnum; // prepare for emsg() - sourcing_name = "modelines"; + // prepare for emsg() + estack_push(ETYPE_MODELINE, "modelines", lnum); end = false; while (end == false) { @@ -5238,7 +5235,7 @@ static int chk_modeline(linenr_T lnum, int flags) const sctx_T save_current_sctx = current_sctx; current_sctx.sc_sid = SID_MODELINE; current_sctx.sc_seq = 0; - current_sctx.sc_lnum = 0; + current_sctx.sc_lnum = lnum; // Make sure no risky things are executed as a side effect. secure = 1; @@ -5253,9 +5250,7 @@ static int chk_modeline(linenr_T lnum, int flags) s = e + 1; // advance to next part } - sourcing_lnum = save_sourcing_lnum; - sourcing_name = save_sourcing_name; - + estack_pop(); xfree(linecopy); return retval; |