lua-users home
lua-l archive

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


> Try this lua program:
> 
> -----
> function f(p1,p2,p3,p4,p5,p6,p7,p8,p9,...)
>   local a1,a2,a3,a4,a5,a6,a7
>   local a8,a9,a10,a11,a12,a13,a14
> end
> 
> f()
> ------
> 
> It crashs.

Yes, there is a bug here. (It is a memory violation, so the crash per se
depends on the circumstances and may not be easily reproducible.)
Thanks for the report.


> I guess this patch will fix it .

It does, but we can avoid this little overhead in the common case
(non-vararg functions).  We can either add p->numparams in the parser
(so that the final maxstacksize of vararg functions already reflect
this extra need) or check for numparams inside adjust_varargs, only for
vararg functions. I will check what is best.

Again, many thanks for the report.

-- Roberto