| 1044 | |
| 1045 | |
| 1046 | static const char *aux_upvalue (StkId fi, int n, TValue **val) { |
| 1047 | Closure *f; |
| 1048 | if (!ttisfunction(fi)) return NULL; |
| 1049 | f = clvalue(fi); |
| 1050 | if (f->c.isC) { |
| 1051 | if (!(1 <= n && n <= f->c.nupvalues)) return NULL; |
| 1052 | *val = &f->c.upvalue[n-1]; |
| 1053 | return ""; |
| 1054 | } |
| 1055 | else { |
| 1056 | Proto *p = f->l.p; |
| 1057 | if (!(1 <= n && n <= p->sizeupvalues)) return NULL; |
| 1058 | *val = f->l.upvals[n-1]->v; |
| 1059 | return getstr(p->upvalues[n-1]); |
| 1060 | } |
| 1061 | } |
| 1062 | |
| 1063 | |
| 1064 | LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { |
no test coverage detected