lua-users home
lua-l archive

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


On Tue, 21 Jul 2020 at 19:55, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
>
> On Tue, 21 Jul 2020 at 17:58, Roberto Ierusalimschy
> <roberto@inf.puc-rio.br> wrote:

> > The upvalue is removed from the open list only after the call. If
> > there is an error, that sequence is interrupted, and the upvalue
> > is not removed from the list. It would be easy to remove it
> > before the call, if we preferred not to do the call again.
> >
>
> Thank you - I think you mean this commit:
> https://github.com/lua/lua/commit/c220b0a5d099372e58e517b9f13eaa7bb0bec45c
> ?
>
> I did try reverting the commit but it caused some failure in the
> tests. But that was just my initial look - I will look deeper.
>

If I just move the following lines to where they used to be prior to
above commit:

    if (uv->tbc && status != NOCLOSINGMETH) {
      /* must run closing method, which may change the stack */
      ptrdiff_t levelrel = savestack(L, level);
      status = callclosemth(L, uplevel(uv), status);
      level = restorestack(L, levelrel);
    }

It crashes with memory error when running the tests in local. (I am
currently testing on Windows 10, but will also test on Linux later).
The crash occurs in the first test after printing "testing errors in __close".
So I am unsure what else needs to change...
I would expect test to fail rather than crash.

Regards
Dibyendu