| 117 | |
| 118 | |
| 119 | void 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 | |
| 137 | static int callbinTM (lua_State *L, const TValue *p1, const TValue *p2, |
no test coverage detected