fix(eval): handle wrong v:lua in expr option properly (#29953)

This commit is contained in:
zeertzjq
2024-08-02 16:00:27 +08:00
committed by GitHub
parent 76dea5feaa
commit 2a3561819e
3 changed files with 41 additions and 1 deletions

View File

@@ -1779,6 +1779,9 @@ theend:
int call_simple_luafunc(const char *funcname, size_t len, typval_T *rettv)
FUNC_ATTR_NONNULL_ALL
{
rettv->v_type = VAR_NUMBER; // default rettv is number zero
rettv->vval.v_number = 0;
typval_T argvars[1];
argvars[0].v_type = VAR_UNKNOWN;
nlua_typval_call(funcname, len, argvars, 0, rettv);