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

Function lastlevel

third-party/lua-5.5.0/src/lauxlib.c:112–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111
112static int lastlevel (lua_State *L) {
113 lua_Debug ar;
114 int li = 1, le = 1;
115 /* find an upper bound */
116 while (lua_getstack(L, le, &ar)) { li = le; le *= 2; }
117 /* do a binary search */
118 while (li < le) {
119 int m = (li + le)/2;
120 if (lua_getstack(L, m, &ar)) li = m + 1;
121 else le = m;
122 }
123 return le - 1;
124}
125
126
127LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1,

Callers 1

luaL_tracebackFunction · 0.70

Calls 1

lua_getstackFunction · 0.70

Tested by

no test coverage detected