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