lua-users home
lua-l archive

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


As a temporary work around I have defeated the compile time constant detection in lparser.c (line 1774), and this problem goes away.

For some reason the OP_CLOSE for the end of the "do .. end" block is not generated if this block is preceded by a couple of compile time constant declarations.


On Fri, May 22, 2020 at 11:45 AM Gé Weijers <ge@weijers.org> wrote:
A bit more digging: the file is not closed at the end of the 'do ... end' block. Tracing the system calls shows that the file is closed after the error message (probably by __gc).

If I look at the generated code it seems like the slot for variable 'file' gets reused by 'database'.


On Fri, May 22, 2020 at 11:34 AM Gé Weijers <ge@weijers.org> wrote:

BTW: platform: 64-bit x86 Debian 10 Linux.

I tested this with an unmodified Lua, built with the distributed Makefile to rule out any mistakes on my part.

Thanks,



--



--