diff options
Diffstat (limited to 'apps/plugins/lua/lapi.c')
-rw-r--r-- | apps/plugins/lua/lapi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/plugins/lua/lapi.c b/apps/plugins/lua/lapi.c index 6426cd94a9..120f8c8313 100644 --- a/apps/plugins/lua/lapi.c +++ b/apps/plugins/lua/lapi.c | |||
@@ -1057,8 +1057,11 @@ static const char *aux_upvalue (StkId fi, int n, TValue **val) { | |||
1057 | } | 1057 | } |
1058 | else { | 1058 | else { |
1059 | Proto *p = f->l.p; | 1059 | Proto *p = f->l.p; |
1060 | if (!(1 <= n && n <= p->sizeupvalues)) return NULL; | 1060 | if (!(1 <= n && n <= p->nups)) // not a valid upvalue |
1061 | return NULL; | ||
1061 | *val = f->l.upvals[n-1]->v; | 1062 | *val = f->l.upvals[n-1]->v; |
1063 | if (!(1 <= n && n <= p->sizeupvalues)) // don't have a name for this upvalue | ||
1064 | return ""; | ||
1062 | return getstr(p->upvalues[n-1]); | 1065 | return getstr(p->upvalues[n-1]); |
1063 | } | 1066 | } |
1064 | } | 1067 | } |