diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-13 13:48:11 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-08-14 04:29:44 +0800 |
commit | f52c236c5b432629f0e074c3511e7e9d481197b1 (patch) | |
tree | 7a489a7a2a50db96e4aef4eeb24fd1cec2e78d5b /src/nvim/eval.c | |
parent | c1cbe3fb3d2ec1dbcfdc14ee2d9a5e8049d494ae (diff) | |
download | rneovim-f52c236c5b432629f0e074c3511e7e9d481197b1.tar.gz rneovim-f52c236c5b432629f0e074c3511e7e9d481197b1.tar.bz2 rneovim-f52c236c5b432629f0e074c3511e7e9d481197b1.zip |
vim-patch:8.2.0056: execution stack is incomplete and inefficient
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.
https://github.com/vim/vim/commit/1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506
Omit test_debugger.vim: superseded by later patches.
Omit check_map_keycodes(): N/A.
Omit kword_test.c: N/A (converted to a unit test).
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 0cd2c7314d..fb035d993a 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -49,6 +49,7 @@ #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" +#include "nvim/runtime.h" #include "nvim/screen.h" #include "nvim/search.h" #include "nvim/sign.h" @@ -8613,8 +8614,8 @@ typval_T eval_call_provider(char *provider, char *method, list_T *arguments, boo struct caller_scope saved_provider_caller_scope = provider_caller_scope; provider_caller_scope = (struct caller_scope) { .script_ctx = current_sctx, - .sourcing_name = sourcing_name, - .sourcing_lnum = sourcing_lnum, + .sourcing_name = SOURCING_NAME, + .sourcing_lnum = SOURCING_LNUM, .autocmd_fname = autocmd_fname, .autocmd_match = autocmd_match, .autocmd_bufnr = autocmd_bufnr, @@ -8713,8 +8714,8 @@ bool eval_has_provider(const char *feat) /// Writes "<sourcing_name>:<sourcing_lnum>" to `buf[bufsize]`. void eval_fmt_source_name_line(char *buf, size_t bufsize) { - if (sourcing_name) { - snprintf(buf, bufsize, "%s:%" PRIdLINENR, sourcing_name, sourcing_lnum); + if (SOURCING_NAME) { + snprintf(buf, bufsize, "%s:%" PRIdLINENR, SOURCING_NAME, SOURCING_LNUM); } else { snprintf(buf, bufsize, "?"); } |