MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / lua_getlocal

Function lua_getlocal

ogsr_engine/LuaJIT/src/lj_debug.c:404–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402/* lua_getupvalue() and lua_setupvalue() are in lj_api.c. */
403
404LUA_API const char *lua_getlocal(lua_State *L, const lua_Debug *ar, int n)
405{
406 const char *name = NULL;
407 if (ar) {
408 TValue *o = debug_localname(L, ar, &name, (BCReg)n);
409 if (name) {
410 copyTV(L, L->top, o);
411 incr_top(L);
412 }
413 } else if (tvisfunc(L->top-1) && isluafunc(funcV(L->top-1))) {
414 name = debug_varname(funcproto(funcV(L->top-1)), 0, (BCReg)n-1);
415 }
416 return name;
417}
418
419LUA_API const char *lua_setlocal(lua_State *L, const lua_Debug *ar, int n)
420{

Callers 3

lib_debug.cFile · 0.85
dump_stateMethod · 0.85
stage1Method · 0.85

Calls 3

debug_localnameFunction · 0.85
copyTVFunction · 0.85
debug_varnameFunction · 0.85

Tested by

no test coverage detected