** Look for n-th local variable at line 'line' in function 'func'. ** Returns NULL if not found. */
| 281 | ** Returns NULL if not found. |
| 282 | */ |
| 283 | const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { |
| 284 | int i; |
| 285 | for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { |
| 286 | if (pc < f->locvars[i].endpc) { /* is variable active? */ |
| 287 | local_number--; |
| 288 | if (local_number == 0) |
| 289 | return getstr(f->locvars[i].varname); |
| 290 | } |
| 291 | } |
| 292 | return NULL; /* not found */ |
| 293 | } |
| 294 |
no outgoing calls
no test coverage detected