** Look for n-th local variable at line `line' in function `func'. ** Returns NULL if not found. */
| 5989 | ** Returns NULL if not found. |
| 5990 | */ |
| 5991 | const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { |
| 5992 | int i; |
| 5993 | for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { |
| 5994 | if (pc < f->locvars[i].endpc) { /* is variable active? */ |
| 5995 | local_number--; |
| 5996 | if (local_number == 0) |
| 5997 | return getstr(f->locvars[i].varname); |
| 5998 | } |
| 5999 | } |
| 6000 | return NULL; /* not found */ |
| 6001 | } |
| 6002 | |
| 6003 | /* |
| 6004 | ** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $ |
no outgoing calls
no test coverage detected