lua-users home
lua-l archive

Fwd: Rings bug(?) and fix

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


Hi,
It appears that every call to dostring in the rings module [1] leaves the debug.traceback function on the ring state's stack, which may accumulate. Is this a problem? Could it eventually explode the stack, or does Lua take care of this?
In any case, it can be resolved by changing
	lua_pop (dst, ret_top-base);
to
	lua_pop (dst, ret_top-base+1);
on line 144, and
	lua_pop (dst, 1); /* pops result from dst state */
to
	lua_pop (dst, 2); /* pops result & debug.traceback from dst state */
on line 150,
of the current release (1.2.1)
[1] http://www.keplerproject.org/rings/

AltStyle によって変換されたページ (->オリジナル) /