[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luaL_getn segfault
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 29 Jul 2003 13:35:58 -0300
> The following piece of code causes Lua to crash in luaH_getstr on my
> system (using the Debian Lua packages):
> ...
> lua_rawgeti(l_st, LUA_REGISTRYINDEX, LUA_NOREF);
> luaL_getn(l_st, -1);
This is a type error. The result of `lua_rawgeti' is nil, right? So, if
you apply `luaL_getn' over nil you get such error. The C API does not
check its arguments (this is C after all ;) If you want to check this
kind of thing, you can recompile Lua defining `api_check' (see lapi.c).
-- Roberto