MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / lua_setupvalue

Function lua_setupvalue

src/lapi.cpp:1516–1532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1514
1515
1516LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
1517 const char *name;
1518 TValue *val = NULL; /* to avoid warnings */
1519 GCObject *owner = NULL; /* to avoid warnings */
1520 TValue *fi;
1521 lua_lock(L);
1522 fi = index2value(L, funcindex);
1523 api_checknelems(L, 1);
1524 name = aux_upvalue(fi, n, &val, &owner);
1525 if (name) {
1526 L->top.p--;
1527 setobj(L, val, s2v(L->top.p));
1528 luaC_barrier(L, owner, val);
1529 }
1530 lua_unlock(L);
1531 return name;
1532}
1533
1534
1535static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) {

Callers 2

auxupvalueFunction · 0.85
load_auxFunction · 0.85

Calls 2

index2valueFunction · 0.85
aux_upvalueFunction · 0.85

Tested by

no test coverage detected