diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 7b3726486f..be9d0abc42 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -87,6 +87,8 @@ #define DICT_MAXNEST 100 // maximum nesting of lists and dicts +#define MAX_CALLBACK_DEPTH 20 + static const char *e_missbrac = N_("E111: Missing ']'"); static const char *e_list_end = N_("E697: Missing end of List ']': %s"); static const char e_cannot_slice_dictionary[] @@ -6061,7 +6063,7 @@ 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) { + if (callback_depth > MAX_CALLBACK_DEPTH) { emsg(_(e_command_too_recursive)); return false; } |