lua-users home
lua-l archive

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


Hi there,

	I just took the work5 version of code and integrated it into my
ucontroller source base, all appears to be going well, however since the
ucontroller is 16-bit with 16-bit integers i have run into a problem
when running the following code.

	"func = function(k,v) print(k,v) end;"

	I end up with a load error with the error message of "too many local
variables". I tracked things through a little more and the
problem appears that due to the 16-bit integers of this platform the
following code causes a problem.

lparser.c:171
  luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars,
                  LocVar, USHRT_MAX, "too many local variables");

	This provides to the luaM_growvector a value of USHRT_MAX for the limit
parameter in the function call of luaM_growaux_, now since this system
is a 16-bit int system that equates to -1. So perhaps the code is meant
to read as follows?

lparser.c:171
  luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars,
                  LocVar, INT_MAX, "too many local variables");


	Comments are welcome.

Andrew.