| 1069 | |
| 1070 | |
| 1071 | LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { |
| 1072 | const char *name; |
| 1073 | TValue *val; |
| 1074 | StkId fi; |
| 1075 | lua_lock(L); |
| 1076 | fi = index2adr(L, funcindex); |
| 1077 | api_checknelems(L, 1); |
| 1078 | name = aux_upvalue(fi, n, &val); |
| 1079 | if (name) { |
| 1080 | L->top--; |
| 1081 | setobj(L, val, L->top); |
| 1082 | luaC_barrier(L, clvalue(fi), L->top); |
| 1083 | } |
| 1084 | lua_unlock(L); |
| 1085 | return name; |
| 1086 | } |
| 1087 |
no test coverage detected