[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: isLmark() segmentation violation
- From: Edgar Toernig <froese@...>
- Date: Tue, 04 Dec 2001 11:10:05 +0100
Hi,
Taj Khattra wrote:
>
> Segmentation fault (core dumped)
It's a bug in luaL_argerror (doesn't check result of lua_getstack)[1].
But anyway:
> newL = lua_newthread(L, 0);
> luaL_check_rawtype(L, 1, LUA_TFUNCTION);
> ref = luaL_ref(L, LUA_REGISTRYINDEX);
> lua_rawgeti(newL, LUA_REGISTRYINDEX, ref);
> luaL_unref(L, LUA_REGISTRYINDEX, ref);
> lua_call(newL, 0, 1);
> code = luaL_check_int(newL, 1);
> lua_close(newL);
the error occured in luaL_check_int(newL, 1). Note, if there wouldn't
be this segault, the program would have terminated anyway because
there's noone to return to in case of an error. The error is raised
in newL where no "catcher" has been set.
Ciao, ET.
[1] Or should lua_getstack fill ar for level 0?
PS: luaL_check_int is meant for arguments, not results.