** Look for n-th local variable at line 'line' in function 'func'. ** Returns NULL if not found. */
| 138 | ** Returns NULL if not found. |
| 139 | */ |
| 140 | const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { |
| 141 | int i; |
| 142 | for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { |
| 143 | if (pc < f->locvars[i].endpc) { /* is variable active? */ |
| 144 | local_number--; |
| 145 | if (local_number == 0) |
| 146 | return getstr(f->locvars[i].varname); |
| 147 | } |
| 148 | } |
| 149 | return NULL; /* not found */ |
| 150 | } |
| 151 |
no outgoing calls
no test coverage detected