MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_setupvalue

Function lua_setupvalue

extlibs/lua/src/lapi.c:1353–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1351
1352
1353LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
1354 const char *name;
1355 TValue *val = NULL; /* to avoid warnings */
1356 GCObject *owner = NULL; /* to avoid warnings */
1357 TValue *fi;
1358 lua_lock(L);
1359 fi = index2value(L, funcindex);
1360 api_checknelems(L, 1);
1361 name = aux_upvalue(fi, n, &val, &owner);
1362 if (name) {
1363 L->top--;
1364 setobj(L, val, s2v(L->top));
1365 luaC_barrier(L, owner, val);
1366 }
1367 lua_unlock(L);
1368 return name;
1369}
1370
1371
1372static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) {

Callers 3

load_auxFunction · 0.85
auxupvalueFunction · 0.85
set_onMethod · 0.85

Calls 2

index2valueFunction · 0.85
aux_upvalueFunction · 0.85

Tested by

no test coverage detected