** Look for n-th local variable at line `line' in function `func'. ** Returns NULL if not found. */
| 161 | ** Returns NULL if not found. |
| 162 | */ |
| 163 | const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { |
| 164 | int i; |
| 165 | for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { |
| 166 | if (pc < f->locvars[i].endpc) { /* is variable active? */ |
| 167 | local_number--; |
| 168 | if (local_number == 0) |
| 169 | return getstr(f->locvars[i].varname); |
| 170 | } |
| 171 | } |
| 172 | return NULL; /* not found */ |
| 173 | } |
| 174 |
no outgoing calls
no test coverage detected