| 316 | |
| 317 | |
| 318 | static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { |
| 319 | if (ci == NULL) /* no 'ci'? */ |
| 320 | return NULL; /* no info */ |
| 321 | else if (ci->callstatus & CIST_FIN) { /* is this a finalizer? */ |
| 322 | *name = "__gc"; |
| 323 | return "metamethod"; /* report it as such */ |
| 324 | } |
| 325 | /* calling function is a known Lua function? */ |
| 326 | else if (!(ci->callstatus & CIST_TAIL) && isLua(ci->previous)) |
| 327 | return funcnamefromcode(L, ci->previous, name); |
| 328 | else return NULL; /* no way to find a name */ |
| 329 | } |
| 330 | |
| 331 | |
| 332 | static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, |
no test coverage detected