MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaT_callTM

Function luaT_callTM

ThirdParty/lua/lua/ltm.c:86–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1,
87 const TValue *p2, TValue *p3, int hasres) {
88 ptrdiff_t result = savestack(L, p3);
89 setobj2s(L, L->top++, f); /* push function (assume EXTRA_STACK) */
90 setobj2s(L, L->top++, p1); /* 1st argument */
91 setobj2s(L, L->top++, p2); /* 2nd argument */
92 if (!hasres) /* no result? 'p3' is third argument */
93 setobj2s(L, L->top++, p3); /* 3rd argument */
94 /* metamethod may yield only when called from Lua code */
95 luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci));
96 if (hasres) { /* if has result, move it to its place */
97 p3 = restorestack(L, result);
98 setobjs2s(L, p3, --L->top);
99 }
100}
101
102
103int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2,

Callers 5

luaV_gettableFunction · 0.85
luaV_settableFunction · 0.85
luaV_equalobjFunction · 0.85
luaV_objlenFunction · 0.85
luaT_callbinTMFunction · 0.85

Calls 1

luaD_callFunction · 0.85

Tested by

no test coverage detected