lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 9 Jul 2020 at 15:18, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>
> > vmcase(OP_RETURN) {
> > int n = GETARG_B(i) - 1; /* number of results */
> > int nparams1 = GETARG_C(i);
> > if (n < 0) /* not fixed? */
> > n = cast_int(L->top - ra); /* get what is available */
> > savepc(ci);
> > if (TESTARG_k(i)) { /* may there be open upvalues? */
> > if (L->top < ci->top)
> > L->top = ci->top;
> > luaF_close(L, base, LUA_OK);
> > updatetrap(ci);
> > updatestack(ci);
> > }
> > if (nparams1) /* vararg function? */
> > ci->func -= ci->u.l.nextraargs + nparams1;
> > L->top = ra + n; /* set call for 'luaD_poscall' */
> > luaD_poscall(L, ci, n);
> > return;
> > }
> >
> > The use of ra - is ra still correct? Stacke may have been reallocated?
> > There was similar  bug in Ravi.
>
> Note the macro updatestack: It should correct 'ra' in case of a stack
> reallocation.
>

Ah okay so that's fine. Sorry for the noise.

Regards