lua-users home
lua-l archive

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


On Fri, 21 Dec 2001, Eric Mauger wrote:

> Hi,
>
> I made a small mistake in a script :
>
> t = { }
> rawget(t, "test", 1)
>
> and it caused a Segmentation Fault.

A silly bug. Thanks for the report. The correction is (in 4.0):

lbaselib.c: 168: function luaB_rawget
- lua_rawget(L, -2);
+ lua_rawget(L, 1);

lbaselib.c: 172: function luaB_rawset
- lua_rawset(L, -3);
+ lua_rawset(L, 1);

(rawset has the same bug...)  Version work3 has the same problem, and
a similar correction.

-- Roberto