1
0
forked from aniani/vim

patch 9.0.1320: checking the type of a null object causes a crash

Problem:    Checking the type of a null object causes a crash.
Solution:   Don't try to get the class of a null object. (closes #12005)
            Handle error from calling a user function better.
This commit is contained in:
Bram Moolenaar
2023-02-18 14:42:44 +00:00
parent 9de960ace0
commit 0917e86763
10 changed files with 94 additions and 48 deletions

View File

@@ -2776,11 +2776,11 @@ luaV_call_lua_func(
if (lua_pcall(funcstate->L, luaargcount, 1, 0))
{
luaV_emsg(funcstate->L);
return FCERR_OTHER;
return (int)FCERR_OTHER;
}
luaV_checktypval(funcstate->L, -1, rettv, "get return value");
return FCERR_NONE;
return (int)FCERR_NONE;
}
/*