** Look for n-th local variable at line `line' in function `func'. ** Returns NULL if not found. */
| 148 | ** Returns NULL if not found. |
| 149 | */ |
| 150 | const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { |
| 151 | int i; |
| 152 | for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { |
| 153 | if (pc < f->locvars[i].endpc) { /* is variable active? */ |
| 154 | local_number--; |
| 155 | if (local_number == 0) |
| 156 | return getstr(f->locvars[i].varname); |
| 157 | } |
| 158 | } |
| 159 | return NULL; /* not found */ |
| 160 | } |
| 161 |
no outgoing calls
no test coverage detected