lua-users home
lua-l archive

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


> Lua crashes (access violation) when using '...' under certain
> circumstances.

> Another bug; may be related. This program:
> [...]
> Quickly (within a few seconds) consumes all available RAM on my system

I hope the following patch (in file ldo.c) solves both problems with
varargs. Please let me know the results. (Should I use the context
format for diff?)

diff -r2.7 ldo.c
195a196
>     luaC_checkGC(L);
247,248d247
<     luaD_checkstack(L, p->maxstacksize);
<     func = restorestack(L, funcr);
250c249,250
<       int nargs = L->top - func - 1;
---
>       int nargs = L->top - restorestack(L, funcr) - 1;
>       luaD_checkstack(L, p->maxstacksize + nargs);
251a252
>       func = restorestack(L, funcr);
253c254,256
<     else
---
>     else {
>       luaD_checkstack(L, p->maxstacksize);
>       func = restorestack(L, funcr);
254a258
>     }


-- Roberto