Mercurial > vim
comparison src/userfunc.c @ 34001:1489ba07ecb4 v9.0.2183
patch 9.0.2183: Maximum callback depth is not configurable
Commit: https://github.com/vim/vim/commit/fe583b1e5987fbfdb5f2141c133dbff9665ed301
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Dec 21 16:59:26 2023 +0100
patch 9.0.2183: Maximum callback depth is not configurable
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 21 Dec 2023 17:15:06 +0100 |
parents | 7c30841c60a0 |
children | 1629cc65d78d |
comparison
equal
deleted
inserted
replaced
34000:9427e17a20d4 | 34001:1489ba07ecb4 |
---|---|
12 */ | 12 */ |
13 | 13 |
14 #include "vim.h" | 14 #include "vim.h" |
15 | 15 |
16 #if defined(FEAT_EVAL) || defined(PROTO) | 16 #if defined(FEAT_EVAL) || defined(PROTO) |
17 | |
18 #define MAX_CALLBACK_DEPTH 20 | |
19 | |
20 /* | 17 /* |
21 * All user-defined functions are found in this hashtable. | 18 * All user-defined functions are found in this hashtable. |
22 */ | 19 */ |
23 static hashtab_T func_hashtab; | 20 static hashtab_T func_hashtab; |
24 | 21 |
3601 int ret; | 3598 int ret; |
3602 | 3599 |
3603 if (callback->cb_name == NULL || *callback->cb_name == NUL) | 3600 if (callback->cb_name == NULL || *callback->cb_name == NUL) |
3604 return FAIL; | 3601 return FAIL; |
3605 | 3602 |
3606 if (callback_depth > MAX_CALLBACK_DEPTH) | 3603 if (callback_depth > p_mfd) |
3607 { | 3604 { |
3608 emsg(_(e_command_too_recursive)); | 3605 emsg(_(e_command_too_recursive)); |
3609 return FAIL; | 3606 return FAIL; |
3610 } | 3607 } |
3611 | 3608 |