MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / getupvalref

Function getupvalref

3rd/lua-5.4.3/src/lapi.c:1409–1420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1407
1408
1409static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) {
1410 static const UpVal *const nullup = NULL;
1411 LClosure *f;
1412 TValue *fi = index2value(L, fidx);
1413 api_check(L, ttisLclosure(fi), "Lua function expected");
1414 f = clLvalue(fi);
1415 if (pf) *pf = f;
1416 if (1 <= n && n <= f->p->sizeupvalues)
1417 return &f->upvals[n - 1]; /* get its upvalue pointer */
1418 else
1419 return (UpVal**)&nullup;
1420}
1421
1422
1423LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {

Callers 2

lua_upvalueidFunction · 0.85
lua_upvaluejoinFunction · 0.85

Calls 1

index2valueFunction · 0.85

Tested by

no test coverage detected