| 2886 | |
| 2887 | |
| 2888 | static const char *aux_upvalue (StkId fi, int n, TValue **val) { |
| 2889 | Closure *f; |
| 2890 | if (!ttisfunction(fi)) return NULL; |
| 2891 | f = clvalue(fi); |
| 2892 | if (f->c.isC) { |
| 2893 | if (!(1 <= n && n <= f->c.nupvalues)) return NULL; |
| 2894 | *val = &f->c.upvalue[n-1]; |
| 2895 | return ""; |
| 2896 | } |
| 2897 | else { |
| 2898 | Proto *p = f->l.p; |
| 2899 | if (!(1 <= n && n <= p->sizeupvalues)) return NULL; |
| 2900 | *val = f->l.upvals[n-1]->v; |
| 2901 | return getstr(p->upvalues[n-1]); |
| 2902 | } |
| 2903 | } |
| 2904 | |
| 2905 | |
| 2906 | LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { |
no outgoing calls
no test coverage detected