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

Function lua_upvalueid

third-party/lua-5.3.5/src/lapi.c:1268–1284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1266
1267
1268LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {
1269 StkId fi = index2addr(L, fidx);
1270 switch (ttype(fi)) {
1271 case LUA_TLCL: { /* lua closure */
1272 return *getupvalref(L, fidx, n, NULL);
1273 }
1274 case LUA_TCCL: { /* C closure */
1275 CClosure *f = clCvalue(fi);
1276 api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index");
1277 return &f->upvalue[n - 1];
1278 }
1279 default: {
1280 api_check(L, 0, "closure expected");
1281 return NULL;
1282 }
1283 }
1284}
1285
1286
1287LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,

Callers 1

db_upvalueidFunction · 0.70

Calls 2

index2addrFunction · 0.70
getupvalrefFunction · 0.70

Tested by

no test coverage detected