| 288 | |
| 289 | |
| 290 | static 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 | |
| 312 | static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { |
no test coverage detected