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

Function lua_setupvalue

third-party/lua-5.5.0/src/lapi.c:1408–1424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1406
1407
1408LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
1409 const char *name;
1410 TValue *val = NULL; /* to avoid warnings */
1411 GCObject *owner = NULL; /* to avoid warnings */
1412 TValue *fi;
1413 lua_lock(L);
1414 fi = index2value(L, funcindex);
1415 api_checknelems(L, 1);
1416 name = aux_upvalue(fi, n, &val, &owner);
1417 if (name) {
1418 L->top.p--;
1419 setobj(L, val, s2v(L->top.p));
1420 luaC_barrier(L, owner, val);
1421 }
1422 lua_unlock(L);
1423 return name;
1424}
1425
1426
1427static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) {

Callers 4

load_auxFunction · 0.70
auxupvalueFunction · 0.70
DoEvalMethod · 0.50
lua_setfenvFunction · 0.50

Calls 2

index2valueFunction · 0.70
aux_upvalueFunction · 0.70

Tested by

no test coverage detected