[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: tolua 4.0a: critical bug + patch
- From: Waldemar Celes <celes@...>
- Date: Mon, 12 Mar 2001 16:38:56 -0300
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.
> 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