lua-users home
lua-l archive

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


sorry about that. the constant LUA_NIL, that should be used as
a default value, is part of my TODO list, as documented in the tolua.h file.
your fix works fine assuming the default value is always nil.

-- waldemar

> The attached patch fixes a bug in tolua 4.0a that can cause bogus
> object references to appear. These are to objects on the C stack that
> have already been destroyed. Under certain circumstances - when the
> C stack patterns are just so - these can cause a VERY difficult to find
> and to reproduce crash in the lua GC.
>
> I think it may be better to rewrite the functions in tolua_lb.c to use
> the lua API directly, instead of creating tolua bindings for
> them. With the new lua API, using tolua pkg files to bind functions
> that manipulate the lua stack feels distinctly awkward and is
> error-prone, as this bug demonstrates.
>
> - Christian
>