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

Function luaT_callTMres

extlibs/lua/src/ltm.c:119–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119void luaT_callTMres (lua_State *L, const TValue *f, const TValue *p1,
120 const TValue *p2, StkId res) {
121 ptrdiff_t result = savestack(L, res);
122 StkId func = L->top;
123 setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */
124 setobj2s(L, func + 1, p1); /* 1st argument */
125 setobj2s(L, func + 2, p2); /* 2nd argument */
126 L->top += 3;
127 /* metamethod may yield only when called from Lua code */
128 if (isLuacode(L->ci))
129 luaD_call(L, func, 1);
130 else
131 luaD_callnoyield(L, func, 1);
132 res = restorestack(L, result);
133 setobjs2s(L, res, --L->top); /* move result to its place */
134}
135
136
137static int callbinTM (lua_State *L, const TValue *p1, const TValue *p2,

Callers 4

luaV_finishgetFunction · 0.85
luaV_equalobjFunction · 0.85
luaV_objlenFunction · 0.85
callbinTMFunction · 0.85

Calls 2

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected