** Try to find a name for a function based on how it was called. */
| 653 | ** Try to find a name for a function based on how it was called. |
| 654 | */ |
| 655 | static const char *funcnamefromcall (lua_State *L, CallInfo *ci, |
| 656 | const char **name) { |
| 657 | if (ci->callstatus & CIST_HOOKED) { /* was it called inside a hook? */ |
| 658 | *name = "?"; |
| 659 | return "hook"; |
| 660 | } |
| 661 | else if (ci->callstatus & CIST_FIN) { /* was it called as a finalizer? */ |
| 662 | *name = "__gc"; |
| 663 | return "metamethod"; /* report it as such */ |
| 664 | } |
| 665 | else if (isLua(ci)) |
| 666 | return funcnamefromcode(L, ci_func(ci)->p, currentpc(ci), name); |
| 667 | else |
| 668 | return NULL; |
| 669 | } |
| 670 | |
| 671 | /* }====================================================== */ |
| 672 |
no test coverage detected