MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tryfuncTM

Function tryfuncTM

freebsd/contrib/openzfs/module/lua/ldo.c:344–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342
343
344static StkId tryfuncTM (lua_State *L, StkId func) {
345 const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL);
346 StkId p;
347 ptrdiff_t funcr = savestack(L, func);
348 if (!ttisfunction(tm))
349 luaG_typeerror(L, func, "call");
350 /* Open a hole inside the stack at `func' */
351 for (p = L->top; p > func; p--) setobjs2s(L, p, p-1);
352 incr_top(L);
353 func = restorestack(L, funcr); /* previous call may change stack */
354 setobj2s(L, func, tm); /* tag method is the new function to be called */
355 return func;
356}
357
358
359

Callers 1

luaD_precallFunction · 0.70

Calls 2

luaT_gettmbyobjFunction · 0.70
luaG_typeerrorFunction · 0.70

Tested by

no test coverage detected