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