[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Recursive closures using upvalues in C
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Mon, 11 Mar 2013 13:52:14 +0000
2013/3/11 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
>> However if I replace the lua_call second parameter with 0, I get
>> another API check failure, but in that case during the interpreter
>> teardown (ie. after the Lua script finished):
>>
>> Lua API check failed: (p) != luaO_nilobject, file lua-5.1.4\src\lapi.c, line 184
>
> Line 184 is this:
>
> api_checkvalidindex(L, p);
>
> It means that lua_remove is being called with an invalid index (that is,
> an index out of bounds for the current stack).
My line numbers may be slightly off (and significantly in lua.c) from
the official sources, I have several local patches applied. But the
function names in the stack trace should be good.
>From the call stack in my previous email, the lua_remove is called by
docall in lua.c. There is only one call to lua_remove in docall,
however you may want to verify the check failure in a context with
unpatched Lua sources.