** Build a string with a "description" for the value 'o', such as ** "variable 'x'" or "upvalue 'y'". */
| 721 | ** "variable 'x'" or "upvalue 'y'". |
| 722 | */ |
| 723 | static const char *varinfo (lua_State *L, const TValue *o) { |
| 724 | CallInfo *ci = L->ci; |
| 725 | const char *name = NULL; /* to avoid warnings */ |
| 726 | const char *kind = NULL; |
| 727 | if (isLua(ci)) { |
| 728 | kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */ |
| 729 | if (!kind) { /* not an upvalue? */ |
| 730 | int reg = instack(ci, o); /* try a register */ |
| 731 | if (reg >= 0) /* is 'o' a register? */ |
| 732 | kind = getobjname(ci_func(ci)->p, currentpc(ci), reg, &name); |
| 733 | } |
| 734 | } |
| 735 | return formatvarinfo(L, kind, name); |
| 736 | } |
| 737 | |
| 738 | |
| 739 | /* |
no test coverage detected