MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / getfuncname

Function getfuncname

deps/lua/src/ldebug.c:544–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542
543
544static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {
545 Instruction i;
546 if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1))
547 return NULL; /* calling function is not Lua (or is unknown) */
548 ci--; /* calling function */
549 i = ci_func(ci)->l.p->code[currentpc(L, ci)];
550 if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL ||
551 GET_OPCODE(i) == OP_TFORLOOP)
552 return getobjname(L, ci, GETARG_A(i), name);
553 else
554 return NULL; /* no useful name can be found */
555}
556
557
558/* only ANSI way to check whether a pointer points to an array */

Callers 1

auxgetinfoFunction · 0.85

Calls 2

currentpcFunction · 0.85
getobjnameFunction · 0.85

Tested by

no test coverage detected