MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaT_callTM

Function luaT_callTM

src/Chain/libraries/glua/ltm.cpp:86–105  ·  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 StkId func = L->top;
90 setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */
91 setobj2s(L, func + 1, p1); /* 1st argument */
92 setobj2s(L, func + 2, p2); /* 2nd argument */
93 L->top += 3;
94 if (!hasres) /* no result? 'p3' is third argument */
95 setobj2s(L, L->top++, p3); /* 3rd argument */
96 /* metamethod may yield only when called from Lua code */
97 if (isLua(L->ci))
98 luaD_call(L, func, hasres);
99 else
100 luaD_callnoyield(L, func, hasres);
101 if (hasres) { /* if has result, move it to its place */
102 p3 = restorestack(L, result);
103 setobjs2s(L, p3, --L->top);
104 }
105}
106
107
108int luaT_callbinTM(lua_State *L, const TValue *p1, const TValue *p2,

Callers 5

luaT_callbinTMFunction · 0.85
luaV_finishgetFunction · 0.85
luaV_finishsetFunction · 0.85
luaV_equalobjFunction · 0.85
luaV_objlenFunction · 0.85

Calls 2

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected