MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / aux_upvalue

Function aux_upvalue

Source/Misc/lua/src/lua.c:2888–2903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2886
2887
2888static const char *aux_upvalue (StkId fi, int n, TValue **val) {
2889Closure *f;
2890if (!ttisfunction(fi)) return NULL;
2891f = clvalue(fi);
2892if (f->c.isC) {
2893if (!(1 <= n && n <= f->c.nupvalues)) return NULL;
2894*val = &f->c.upvalue[n-1];
2895return "";
2896}
2897else {
2898Proto *p = f->l.p;
2899if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
2900*val = f->l.upvals[n-1]->v;
2901return getstr(p->upvalues[n-1]);
2902}
2903}
2904
2905
2906LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) {

Callers 2

lua_getupvalueFunction · 0.85
lua_setupvalueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected