mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
eval/encode: Fail when stringifying NULL functions
This commit is contained in:
parent
06cca5dc59
commit
f21725946c
@ -336,8 +336,14 @@ int encode_read_from_list(ListReaderState *const state, char *const buf,
|
|||||||
|
|
||||||
#define TYPVAL_ENCODE_CONV_FUNC_START(tv, fun) \
|
#define TYPVAL_ENCODE_CONV_FUNC_START(tv, fun) \
|
||||||
do { \
|
do { \
|
||||||
ga_concat(gap, "function("); \
|
const char *const fun_ = (const char *)(fun); \
|
||||||
TYPVAL_ENCODE_CONV_STRING(tv, fun, STRLEN(fun)); \
|
if (fun_ == NULL) { \
|
||||||
|
EMSG2(_(e_intern2), "string(): NULL function name"); \
|
||||||
|
ga_concat(gap, "function(NULL"); \
|
||||||
|
} else { \
|
||||||
|
ga_concat(gap, "function("); \
|
||||||
|
TYPVAL_ENCODE_CONV_STRING(tv, fun_, strlen(fun_)); \
|
||||||
|
}\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define TYPVAL_ENCODE_CONV_FUNC_BEFORE_ARGS(tv, len) \
|
#define TYPVAL_ENCODE_CONV_FUNC_BEFORE_ARGS(tv, len) \
|
||||||
|
Loading…
Reference in New Issue
Block a user