[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug report: Luac -l incompatible with LUAI_ASSERT
- From: Ahmed Charles <me+lua-l@...>
- Date: Sun, 12 Sep 2021 11:04:49 +0000
On Monday, September 6th, 2021 at 6:13 AM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> > > If you compile luac with -DLUAI_ASSERT then `luac -l <file>` will no longer work.
>
> > Thanks for the report.
> >
> > For the time being, add this line at the top of luac.c:
> >
> > #undef LUAI_ASSERT
>
> Better yet, you can fix the bug by removing the option -DLUAI_ASSERT.
Note, neither of these solutions would result in finding the memory leak in luac when compiling multiple sources files together.
To find it, at least using the ltests.h/c memory checking, one would have to resolve all of the asserts due to the various GETARG_* functions and then realize that the combine function should have a call to luaM_freearray(L, f->lineinfo, f->sizelineinfo); before setting f->sizelineinfo to zero.
Obviously, I think it would be beneficial to have luac run cleanly when using all of the internal debugging features, there are clearly bugs and the internal debugging clearly finds them, they just need to be run.