MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / aux_upvalue

Function aux_upvalue

lua/lapi.c:1046–1061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1044
1045
1046static const char *aux_upvalue (StkId fi, int n, TValue **val) {
1047 Closure *f;
1048 if (!ttisfunction(fi)) return NULL;
1049 f = clvalue(fi);
1050 if (f->c.isC) {
1051 if (!(1 <= n && n <= f->c.nupvalues)) return NULL;
1052 *val = &f->c.upvalue[n-1];
1053 return "";
1054 }
1055 else {
1056 Proto *p = f->l.p;
1057 if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
1058 *val = f->l.upvals[n-1]->v;
1059 return getstr(p->upvalues[n-1]);
1060 }
1061}
1062
1063
1064LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) {

Callers 2

lua_getupvalueFunction · 0.85
lua_setupvalueFunction · 0.85

Calls 1

getstrFunction · 0.85

Tested by

no test coverage detected