MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / lua_setupvalue

Function lua_setupvalue

3rd/lua-5.4.3/src/lapi.c:1390–1406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1388
1389
1390LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
1391 const char *name;
1392 TValue *val = NULL; /* to avoid warnings */
1393 GCObject *owner = NULL; /* to avoid warnings */
1394 TValue *fi;
1395 lua_lock(L);
1396 fi = index2value(L, funcindex);
1397 api_checknelems(L, 1);
1398 name = aux_upvalue(fi, n, &val, &owner);
1399 if (name) {
1400 L->top--;
1401 setobj(L, val, s2v(L->top));
1402 luaC_barrier(L, owner, val);
1403 }
1404 lua_unlock(L);
1405 return name;
1406}
1407
1408
1409static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) {

Callers 2

load_auxFunction · 0.85
auxupvalueFunction · 0.85

Calls 2

index2valueFunction · 0.85
aux_upvalueFunction · 0.85

Tested by

no test coverage detected