MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / listcode

Function listcode

Dependencies/lua/src/ltests.c:730–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728
729
730static int listcode (lua_State *L) {
731 int pc;
732 Proto *p;
733 luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1),
734 1, "Lua function expected");
735 p = getproto(obj_at(L, 1));
736 lua_newtable(L);
737 setnameval(L, "maxstack", p->maxstacksize);
738 setnameval(L, "numparams", p->numparams);
739 for (pc=0; pc<p->sizecode; pc++) {
740 char buff[100];
741 lua_pushinteger(L, pc+1);
742 lua_pushstring(L, buildop(p, pc, buff));
743 lua_settable(L, -3);
744 }
745 return 1;
746}
747
748
749static int printcode (lua_State *L) {

Callers

nothing calls this directly

Calls 6

lua_iscfunctionFunction · 0.85
setnamevalFunction · 0.85
lua_pushintegerFunction · 0.85
lua_pushstringFunction · 0.85
buildopFunction · 0.85
lua_settableFunction · 0.85

Tested by

no test coverage detected