From 6fccac3f44be01b62b623959361cef2cbb9457a3 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sun, 21 Apr 2024 08:09:53 -0400 Subject: lua extend stars demo plugin extend the stars demo plugin with hit testing and more draw_poly now returns the extent of the figure it drew the sim doesn't strip debug info now unnamed upvals will display "" instead of just ending the debug line [Bugfix] fix make file name conflict for picross Change-Id: If342aaff314972c187fa1f299d956e3482366e57 --- apps/plugins/lua/lapi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps/plugins/lua/lapi.c') 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) { } else { Proto *p = f->l.p; - if (!(1 <= n && n <= p->sizeupvalues)) return NULL; + if (!(1 <= n && n <= p->nups)) // not a valid upvalue + return NULL; *val = f->l.upvals[n-1]->v; + if (!(1 <= n && n <= p->sizeupvalues)) // don't have a name for this upvalue + return ""; return getstr(p->upvalues[n-1]); } } -- cgit v1.2.3