[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question regarding the XML parser binding in PIL
- From: Florian Weimer <fw@...>
- Date: Fri, 21 Nov 2008 18:01:40 +0100
* Sam Roberts:
>> The C callbacks use this L as the Lua state for C-to-Lua calls. I can
>> see that this works if the XML parser object is only accessed through
>> Lua (before every callback, L is properly initialized). In a similar
>
> What do you mean by only accessed through lua? These callbacks are
> registered into a lua_State (valid, of course), so how could they be
> called without that state, L, being properly initialized L?
Suppose the XML parser object is passed to some other library which
uses it some time later, in response to a different call (possibly
from Lua code). This would trigger the callbacks without a call to
lxp_parse on the callstack, which means that the L pointer could be
invalid.