mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Fix lua_*upvalue() when upvalue names aren't in debug info
This commit is contained in:
parent
fb2f146123
commit
85764fc7ea
1 changed files with 3 additions and 1 deletions
|
@ -1285,10 +1285,12 @@ static const char* aux_upvalue(StkId fi, int n, TValue** val)
|
|||
else
|
||||
{
|
||||
Proto* p = f->l.p;
|
||||
if (!(1 <= n && n <= p->sizeupvalues))
|
||||
if (!(1 <= n && n <= p->nups)) // not a valid upvalue
|
||||
return NULL;
|
||||
TValue* r = &f->l.uprefs[n - 1];
|
||||
*val = ttisupval(r) ? upvalue(r)->v : r;
|
||||
if (!(1 <= n && n <= p->sizeupvalues)) // don't have a name for this upvalue
|
||||
return "";
|
||||
return getstr(p->upvalues[n - 1]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue