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

Function tryfuncTM

third-party/lua-5.2.4/src/ldo.c:274–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272
273
274static StkId tryfuncTM (lua_State *L, StkId func) {
275 const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL);
276 StkId p;
277 ptrdiff_t funcr = savestack(L, func);
278 if (!ttisfunction(tm))
279 luaG_typeerror(L, func, "call");
280 /* Open a hole inside the stack at `func' */
281 for (p = L->top; p > func; p--) setobjs2s(L, p, p-1);
282 incr_top(L);
283 func = restorestack(L, funcr); /* previous call may change stack */
284 setobj2s(L, func, tm); /* tag method is the new function to be called */
285 return func;
286}
287
288
289

Callers 1

luaD_precallFunction · 0.70

Calls 2

luaT_gettmbyobjFunction · 0.70
luaG_typeerrorFunction · 0.70

Tested by

no test coverage detected