MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / varinfo

Function varinfo

extlibs/lua/src/ldebug.c:682–693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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