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