MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / aux_upvalue

Function aux_upvalue

deps/lua/src/lapi.c:1039–1054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1037
1038
1039static const char *aux_upvalue (StkId fi, int n, TValue **val) {
1040 Closure *f;
1041 if (!ttisfunction(fi)) return NULL;
1042 f = clvalue(fi);
1043 if (f->c.isC) {
1044 if (!(1 <= n && n <= f->c.nupvalues)) return NULL;
1045 *val = &f->c.upvalue[n-1];
1046 return "";
1047 }
1048 else {
1049 Proto *p = f->l.p;
1050 if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
1051 *val = f->l.upvals[n-1]->v;
1052 return getstr(p->upvalues[n-1]);
1053 }
1054}
1055
1056
1057LUA_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