| 1407 | |
| 1408 | |
| 1409 | static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { |
| 1410 | static const UpVal *const nullup = NULL; |
| 1411 | LClosure *f; |
| 1412 | TValue *fi = index2value(L, fidx); |
| 1413 | api_check(L, ttisLclosure(fi), "Lua function expected"); |
| 1414 | f = clLvalue(fi); |
| 1415 | if (pf) *pf = f; |
| 1416 | if (1 <= n && n <= f->p->sizeupvalues) |
| 1417 | return &f->upvals[n - 1]; /* get its upvalue pointer */ |
| 1418 | else |
| 1419 | return (UpVal**)&nullup; |
| 1420 | } |
| 1421 | |
| 1422 | |
| 1423 | LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) { |
no test coverage detected