** Look for n-th local variable at line 'line' in function 'func'. ** Returns NULL if not found. */
| 301 | ** Returns NULL if not found. |
| 302 | */ |
| 303 | const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { |
| 304 | int i; |
| 305 | for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { |
| 306 | if (pc < f->locvars[i].endpc) { /* is variable active? */ |
| 307 | local_number--; |
| 308 | if (local_number == 0) |
| 309 | return getstr(f->locvars[i].varname); |
| 310 | } |
| 311 | } |
| 312 | return NULL; /* not found */ |
| 313 | } |
| 314 |
no outgoing calls
no test coverage detected