MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_setupvalue

Function lua_setupvalue

third-party/lua-5.2.4/src/lapi.c:1227–1243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1225
1226
1227LUA_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
1246static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) {

Callers 3

load_auxFunction · 0.70
set_envFunction · 0.70
auxupvalueFunction · 0.70

Calls 2

index2addrFunction · 0.70
aux_upvalueFunction · 0.70

Tested by

no test coverage detected