[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: LuaRC reallocstack issue
- From: "Joshua Jensen" <jjensen@...>
- Date: Thu, 23 Sep 2004 00:04:53 -0600
I have communicated this to Drew, but this issue has been fixed now and is
checked into Subversion at http://luaplus.org/.
Josh
-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Powers, Drew
Sent: Friday, September 17, 2004 3:57 PM
To: lua@bazar2.conectiva.com.br
Subject: LuaRC reallocstack issue
Hello,
I've run into a problem using the latest Subversion get of LuaRC (as of
9/15/04) while using a custom memory handler under MSVC++ 7.1. The issue
seems to be related to the cleanarray change added to ldo.c
luaD_reallocstack when growing the stack. The elements within L->top to
L->stack_last are assumed to be initialized in the new memory region,
which realloc does not guarantee. This causes the (i_o2->tt >=
LUA_TSTRING) test to pass depending on the contents of that uninitialized
memory then crashes in ((--gcvalue(i_o2)->gch.ref)<=0)) dereferencing
i_o2->value.
Should this not be calling cleanarray and iterating through those new
elements calling setnilvalue2n instead?
Another minor issue, calling lua_pop(-1) on an empty stack crashes LuaRC in
lua_settop()'s cleanarray.
Thanks,
Drew Powers