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

Function lua_upvalueid

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

Source from the content-addressed store, hash-verified

1439
1440
1441LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {
1442 TValue *fi = index2value(L, fidx);
1443 switch (ttypetag(fi)) {
1444 case LUA_VLCL: { /* lua closure */
1445 return *getupvalref(L, fidx, n, NULL);
1446 }
1447 case LUA_VCCL: { /* C closure */
1448 CClosure *f = clCvalue(fi);
1449 if (1 <= n && n <= f->nupvalues)
1450 return &f->upvalue[n - 1];
1451 /* else */
1452 } /* FALLTHROUGH */
1453 case LUA_VLCF:
1454 return NULL; /* light C functions have no upvalues */
1455 default: {
1456 api_check(L, 0, "function expected");
1457 return NULL;
1458 }
1459 }
1460}
1461
1462
1463LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,

Callers 1

checkupvalFunction · 0.70

Calls 2

index2valueFunction · 0.70
getupvalrefFunction · 0.70

Tested by

no test coverage detected