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

Function lua_setupvalue

deps/lua/src/lapi.c:1071–1086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1069
1070
1071LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
1072 const char *name;
1073 TValue *val;
1074 StkId fi;
1075 lua_lock(L);
1076 fi = index2adr(L, funcindex);
1077 api_checknelems(L, 1);
1078 name = aux_upvalue(fi, n, &val);
1079 if (name) {
1080 L->top--;
1081 setobj(L, val, L->top);
1082 luaC_barrier(L, clvalue(fi), L->top);
1083 }
1084 lua_unlock(L);
1085 return name;
1086}
1087

Callers 1

auxupvalueFunction · 0.85

Calls 2

index2adrFunction · 0.85
aux_upvalueFunction · 0.85

Tested by

no test coverage detected