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