MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / db_setlocal

Function db_setlocal

third-party/lua-5.3.5/src/ldblib.c:224–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222
223
224static int db_setlocal (lua_State *L) {
225 int arg;
226 const char *name;
227 lua_State *L1 = getthread(L, &arg);
228 lua_Debug ar;
229 int level = (int)luaL_checkinteger(L, arg + 1);
230 int nvar = (int)luaL_checkinteger(L, arg + 2);
231 if (!lua_getstack(L1, level, &ar)) /* out of range? */
232 return luaL_argerror(L, arg+1, "level out of range");
233 luaL_checkany(L, arg+3);
234 lua_settop(L, arg+3);
235 checkstack(L, L1, 1);
236 lua_xmove(L, L1, 1);
237 name = lua_setlocal(L1, &ar, nvar);
238 if (name == NULL)
239 lua_pop(L1, 1); /* pop value (if not popped by 'lua_setlocal') */
240 lua_pushstring(L, name);
241 return 1;
242}
243
244
245/*

Callers

nothing calls this directly

Calls 10

getthreadFunction · 0.70
luaL_checkintegerFunction · 0.70
lua_getstackFunction · 0.70
luaL_argerrorFunction · 0.70
luaL_checkanyFunction · 0.70
lua_settopFunction · 0.70
checkstackFunction · 0.70
lua_xmoveFunction · 0.70
lua_setlocalFunction · 0.70
lua_pushstringFunction · 0.70

Tested by

no test coverage detected