aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-15 17:02:17 +0800
committerGitHub <noreply@github.com>2023-10-15 17:02:17 +0800
commite5a424d78ed72613dd5ccc161578f9f6f853a0e8 (patch)
tree171e097e0898a1de8c8bf38798a5110087468d57 /src/nvim/eval.c
parentaa62579a684277d86b1f4a7588464e0ec4227b94 (diff)
downloadrneovim-e5a424d78ed72613dd5ccc161578f9f6f853a0e8.tar.gz
rneovim-e5a424d78ed72613dd5ccc161578f9f6f853a0e8.tar.bz2
rneovim-e5a424d78ed72613dd5ccc161578f9f6f853a0e8.zip
vim-patch:9.0.2030: no max callback recursion limit (#25655)
Problem: no max callback recursion limit Solution: bail out, if max call recursion for callback functions has been reached. This checks the 'maxfuncdepth' setting and throws E169 when a callback function recursively calls itself. closes: vim/vim#13337 closes: vim/vim#13339 https://github.com/vim/vim/commit/47510f3d6598a1218958c03ed11337a43b73f48d Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 74b1dbfb72..b5b40061b5 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -6064,6 +6064,11 @@ bool callback_call(Callback *const callback, const int argcount_in, typval_T *co
typval_T *const rettv)
FUNC_ATTR_NONNULL_ALL
{
+ if (callback_depth > p_mfd) {
+ emsg(_(e_command_too_recursive));
+ return false;
+ }
+
partial_T *partial;
char *name;
Array args = ARRAY_DICT_INIT;