MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_upvalueid

Function lua_upvalueid

extlibs/lua/src/lapi.c:1383–1399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1381
1382
1383LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {
1384 TValue *fi = index2value(L, fidx);
1385 switch (ttypetag(fi)) {
1386 case LUA_VLCL: { /* lua closure */
1387 return *getupvalref(L, fidx, n, NULL);
1388 }
1389 case LUA_VCCL: { /* C closure */
1390 CClosure *f = clCvalue(fi);
1391 api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index");
1392 return &f->upvalue[n - 1];
1393 }
1394 default: {
1395 api_check(L, 0, "closure expected");
1396 return NULL;
1397 }
1398 }
1399}
1400
1401
1402LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,

Callers 1

db_upvalueidFunction · 0.85

Calls 2

index2valueFunction · 0.85
getupvalrefFunction · 0.85

Tested by

no test coverage detected