From 2076463e383901cef44685aaf4b63e4306444f9e Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 12 Nov 2023 16:59:29 +0100 Subject: patch 9.0.2103: recursive callback may cause issues on some archs Problem: recursive callback may cause issues on some archs Solution: Decrease the limit drastically to 20 Recursive callback limit causes problems on some architectures Since commit 47510f3d6598a1218958c03ed11337a43b73f48d we have a test that causes a recursive popup callback function to be executed. However it seems the current limit of 'maxfuncdepth' option value is still too recursive for some 32bit architectures (e.g. 32bit ARM). So instead of allowing a default limit of 100 (default value for 'maxfuncdepth'), let's reduce this limit to 20. I don't think there is a use case where one would need such a high recursive callback limit and a limit of 20 seems reasonable (although it is currently hard-coded). closes: #13495 closes: #13502 Signed-off-by: Christian Brabandt --- src/userfunc.c | 5 ++++- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/userfunc.c b/src/userfunc.c index 5ef0f7d9c9..33e73a9a52 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -14,6 +14,9 @@ #include "vim.h" #if defined(FEAT_EVAL) || defined(PROTO) + +#define MAX_CALLBACK_DEPTH 20 + /* * All user-defined functions are found in this hashtable. */ @@ -3584,7 +3587,7 @@ call_callback( if (callback->cb_name == NULL || *callback->cb_name == NUL) return FAIL; - if (callback_depth > p_mfd) + if (callback_depth > MAX_CALLBACK_DEPTH) { emsg(_(e_command_too_recursive)); return FAIL; diff --git a/src/version.c b/src/version.c index 238e3df101..8afbc403d2 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2103, /**/ 2102, /**/ -- cgit v1.2.3