MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / varinfo

Function varinfo

3rd/lua-5.4.3/src/ldebug.c:678–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676
677
678static const char *varinfo (lua_State *L, const TValue *o) {
679 const char *name = NULL; /* to avoid warnings */
680 CallInfo *ci = L->ci;
681 const char *kind = NULL;
682 if (isLua(ci)) {
683 kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */
684 if (!kind && isinstack(ci, o)) /* no? try a register */
685 kind = getobjname(ci_func(ci)->p, currentpc(ci),
686 cast_int(cast(StkId, o) - (ci->func + 1)), &name);
687 }
688 return (kind) ? luaO_pushfstring(L, " (%s '%s')", kind, name) : "";
689}
690
691
692l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) {

Callers 2

luaG_typeerrorFunction · 0.85
luaG_tointerrorFunction · 0.85

Calls 5

getupvalnameFunction · 0.85
isinstackFunction · 0.85
getobjnameFunction · 0.85
currentpcFunction · 0.85
luaO_pushfstringFunction · 0.85

Tested by

no test coverage detected