| 247 | |
| 248 | |
| 249 | static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { |
| 250 | if (ci == NULL) /* no 'ci'? */ |
| 251 | return NULL; /* no info */ |
| 252 | else if (ci->callstatus & CIST_FIN) { /* is this a finalizer? */ |
| 253 | *name = "__gc"; |
| 254 | return "metamethod"; /* report it as such */ |
| 255 | } |
| 256 | /* calling function is a known Lua function? */ |
| 257 | else if (!(ci->callstatus & CIST_TAIL) && isLua(ci->previous)) |
| 258 | return funcnamefromcode(L, ci->previous, name); |
| 259 | else return NULL; /* no way to find a name */ |
| 260 | } |
| 261 | |
| 262 | |
| 263 | static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, |
no test coverage detected