MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaT_callTM

Function luaT_callTM

libraries/AP_Scripting/lua/src/ltm.c:104–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102
103
104void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1,
105 const TValue *p2, TValue *p3, int hasres) {
106 ptrdiff_t result = savestack(L, p3);
107 StkId func = L->top;
108 setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */
109 setobj2s(L, func + 1, p1); /* 1st argument */
110 setobj2s(L, func + 2, p2); /* 2nd argument */
111 L->top += 3;
112 if (!hasres) /* no result? 'p3' is third argument */
113 setobj2s(L, L->top++, p3); /* 3rd argument */
114 /* metamethod may yield only when called from Lua code */
115 if (isLua(L->ci))
116 luaD_call(L, func, hasres);
117 else
118 luaD_callnoyield(L, func, hasres);
119 if (hasres) { /* if has result, move it to its place */
120 p3 = restorestack(L, result);
121 setobjs2s(L, p3, --L->top);
122 }
123}
124
125
126int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2,

Callers 5

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

Calls 2

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected