| 1225 | |
| 1226 | |
| 1227 | LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { |
| 1228 | const char *name; |
| 1229 | TValue *val = NULL; /* to avoid warnings */ |
| 1230 | GCObject *owner = NULL; /* to avoid warnings */ |
| 1231 | StkId fi; |
| 1232 | lua_lock(L); |
| 1233 | fi = index2addr(L, funcindex); |
| 1234 | api_checknelems(L, 1); |
| 1235 | name = aux_upvalue(fi, n, &val, &owner); |
| 1236 | if (name) { |
| 1237 | L->top--; |
| 1238 | setobj(L, val, L->top); |
| 1239 | luaC_barrier(L, owner, L->top); |
| 1240 | } |
| 1241 | lua_unlock(L); |
| 1242 | return name; |
| 1243 | } |
| 1244 | |
| 1245 | |
| 1246 | static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { |
no test coverage detected