MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / funcnamefromcall

Function funcnamefromcall

lib/lua/src/ldebug.c:655–669  ·  view source on GitHub ↗

** Try to find a name for a function based on how it was called. */

Source from the content-addressed store, hash-verified

653** Try to find a name for a function based on how it was called.
654*/
655static 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

Callers 2

getfuncnameFunction · 0.85
luaG_callerrorFunction · 0.85

Calls 2

funcnamefromcodeFunction · 0.85
currentpcFunction · 0.85

Tested by

no test coverage detected