| 4618 | |
| 4619 | |
| 4620 | static const char *findlocal (lua_State *L, CallInfo *ci, int n) { |
| 4621 | const char *name; |
| 4622 | Proto *fp = getluaproto(ci); |
| 4623 | if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL) |
| 4624 | return name; /* is a local variable in a Lua function */ |
| 4625 | else { |
| 4626 | StkId limit = (ci == L->ci) ? L->top : (ci+1)->func; |
| 4627 | if (limit - ci->base >= n && n > 0) /* is 'n' inside 'ci' stack? */ |
| 4628 | return "(*temporary)"; |
| 4629 | else |
| 4630 | return NULL; |
| 4631 | } |
| 4632 | } |
| 4633 | |
| 4634 | |
| 4635 | LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { |
no test coverage detected