lua-users home
lua-l archive

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


>I'm trying to get the following code to work but I get "error: attempt to call a table value". The commented line works fine but I don't want to use it because I have to specify the table index.
>
>function a(t) -- table constructor a
>	return t 
>end
>b = { a{x=1, y=1}, a{x=2, y=2} } -- error
>-- b = { [1]=a{x=1, y=1}, [2]=a{x=2, y=2} } -- ok
>

This is a known bug in 4.0a (actually since 3.1!), which has been corrected
in 4.0b. Search the archive for 'luaK_tostack' for a one-line patch.
(BTW, 4.0b should be out really-soon-now...)

>By accident I found that if 'return t' was instead 'return a', it segfaulted.

This is probably a C stack overflow, caused by infinite recursion.
--lhf