MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / callTM

Function callTM

third-party/lua-5.2.4/src/lvm.c:93–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92
93static void callTM (lua_State *L, const TValue *f, const TValue *p1,
94 const TValue *p2, TValue *p3, int hasres) {
95 ptrdiff_t result = savestack(L, p3);
96 setobj2s(L, L->top++, f); /* push function */
97 setobj2s(L, L->top++, p1); /* 1st argument */
98 setobj2s(L, L->top++, p2); /* 2nd argument */
99 if (!hasres) /* no result? 'p3' is third argument */
100 setobj2s(L, L->top++, p3); /* 3rd argument */
101 /* metamethod may yield only when called from Lua code */
102 luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci));
103 if (hasres) { /* if has result, move it to its place */
104 p3 = restorestack(L, result);
105 setobjs2s(L, p3, --L->top);
106 }
107}
108
109
110void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {

Callers 5

luaV_gettableFunction · 0.70
luaV_settableFunction · 0.70
call_binTMFunction · 0.70
luaV_equalobj_Function · 0.70
luaV_objlenFunction · 0.70

Calls 1

luaD_callFunction · 0.70

Tested by

no test coverage detected