MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / collectvalidlines

Function collectvalidlines

3rd/lua-5.4.3/src/ldebug.c:290–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288
289
290static void collectvalidlines (lua_State *L, Closure *f) {
291 if (noLuaClosure(f)) {
292 setnilvalue(s2v(L->top));
293 api_incr_top(L);
294 }
295 else {
296 int i;
297 TValue v;
298 const Proto *p = f->l.p;
299 int currentline = p->linedefined;
300 Table *t = luaH_new(L); /* new table to store active lines */
301 sethvalue2s(L, L->top, t); /* push it on stack */
302 api_incr_top(L);
303 setbtvalue(&v); /* boolean 'true' to be the value of all indices */
304 for (i = 0; i < p->sizelineinfo; i++) { /* for all instructions */
305 currentline = nextline(p, currentline, i); /* get its line */
306 luaH_setint(L, t, currentline, &v); /* table[line] = true */
307 }
308 }
309}
310
311
312static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {

Callers 1

lua_getinfoFunction · 0.85

Calls 3

luaH_newFunction · 0.85
nextlineFunction · 0.85
luaH_setintFunction · 0.85

Tested by

no test coverage detected