| 1244 | |
| 1245 | |
| 1246 | static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { |
| 1247 | LClosure *f; |
| 1248 | StkId fi = index2addr(L, fidx); |
| 1249 | api_check(L, ttisLclosure(fi), "Lua function expected"); |
| 1250 | f = clLvalue(fi); |
| 1251 | api_check(L, (1 <= n && n <= f->p->sizeupvalues), "invalid upvalue index"); |
| 1252 | if (pf) *pf = f; |
| 1253 | return &f->upvals[n - 1]; /* get its upvalue pointer */ |
| 1254 | } |
| 1255 | |
| 1256 | |
| 1257 | LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) { |
no test coverage detected