diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-12-21 16:59:26 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-12-21 17:03:31 +0100 |
commit | fe583b1e5987fbfdb5f2141c133dbff9665ed301 (patch) | |
tree | 7dad9140e37547e0e6fa8c587507ec2c736188bd /src | |
parent | 632b38b45fcd5143d7694e8b628400ec5e4520bd (diff) |
patch 9.0.2183: Maximum callback depth is not configurablev9.0.2183
Problem: Maximum callback depth is not configurable.
Solution: Revert patch 9.0.2103. Set 'maxfuncdepth' in test.
(zeertzjq)
fixes: #13732
closes: #13736
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/testdir/test_popupwin.vim | 5 | ||||
-rw-r--r-- | src/userfunc.c | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index d01eccc412..c20ff48c62 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -4206,10 +4206,13 @@ func Test_popupwin_with_error() endfunc func Test_popup_close_callback_recursive() + set maxfuncdepth=20 " this invokes the callback recursively let winid = popup_create('something', #{callback: 'popup_close'}) redraw - call assert_fails('call popup_close(winid)', 'E169') + call assert_fails('call popup_close(winid)', 'E169:') + + set maxfuncdepth& endfunc " vim: shiftwidth=2 sts=2 diff --git a/src/userfunc.c b/src/userfunc.c index ea03e78695..c0a2487b46 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -14,9 +14,6 @@ #include "vim.h" #if defined(FEAT_EVAL) || defined(PROTO) - -#define MAX_CALLBACK_DEPTH 20 - /* * All user-defined functions are found in this hashtable. */ @@ -3603,7 +3600,7 @@ call_callback( if (callback->cb_name == NULL || *callback->cb_name == NUL) return FAIL; - if (callback_depth > MAX_CALLBACK_DEPTH) + if (callback_depth > p_mfd) { emsg(_(e_command_too_recursive)); return FAIL; diff --git a/src/version.c b/src/version.c index 6120c538a7..ec2d0e23bf 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2183, +/**/ 2182, /**/ 2181, |