| 5050 | |
| 5051 | |
| 5052 | static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { |
| 5053 | Instruction i; |
| 5054 | if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1)) |
| 5055 | return NULL; /* calling function is not Lua (or is unknown) */ |
| 5056 | ci--; /* calling function */ |
| 5057 | i = ci_func(ci)->l.p->code[currentpc(L, ci)]; |
| 5058 | if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL || |
| 5059 | GET_OPCODE(i) == OP_TFORLOOP) |
| 5060 | return getobjname(L, ci, GETARG_A(i), name); |
| 5061 | else |
| 5062 | return NULL; /* no useful name can be found */ |
| 5063 | } |
| 5064 | |
| 5065 | |
| 5066 | /* only ANSI way to check whether a pointer points to an array */ |
no test coverage detected