| 1351 | |
| 1352 | |
| 1353 | LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { |
| 1354 | const char *name; |
| 1355 | TValue *val = NULL; /* to avoid warnings */ |
| 1356 | GCObject *owner = NULL; /* to avoid warnings */ |
| 1357 | TValue *fi; |
| 1358 | lua_lock(L); |
| 1359 | fi = index2value(L, funcindex); |
| 1360 | api_checknelems(L, 1); |
| 1361 | name = aux_upvalue(fi, n, &val, &owner); |
| 1362 | if (name) { |
| 1363 | L->top--; |
| 1364 | setobj(L, val, s2v(L->top)); |
| 1365 | luaC_barrier(L, owner, val); |
| 1366 | } |
| 1367 | lua_unlock(L); |
| 1368 | return name; |
| 1369 | } |
| 1370 | |
| 1371 | |
| 1372 | static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { |
no test coverage detected