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

Function lua_upvalueid

third-party/lua-5.2.4/src/lapi.c:1257–1273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1255
1256
1257LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {
1258 StkId fi = index2addr(L, fidx);
1259 switch (ttype(fi)) {
1260 case LUA_TLCL: { /* lua closure */
1261 return *getupvalref(L, fidx, n, NULL);
1262 }
1263 case LUA_TCCL: { /* C closure */
1264 CClosure *f = clCvalue(fi);
1265 api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index");
1266 return &f->upvalue[n - 1];
1267 }
1268 default: {
1269 api_check(L, 0, "closure expected");
1270 return NULL;
1271 }
1272 }
1273}
1274
1275
1276LUA_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