Re: Lua5.4-beta luaopen_package leaves CLIBS table on stack
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua5.4-beta luaopen_package leaves CLIBS table on stack
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: 2020年2月20日 07:56:54 +0000
On 2020年2月19日 at 23:49, Stefan <ste@evelance.de> wrote:
> I'm not sure if it even matters since lua_call(L, 1, 1) in
> luaL_requiref:951 deletes it anyways, but it seems that the
> createclibstable function in loadlib.c forgets a value
> on the stack due to the change from lua_newtable +
> lua_rawsetp to luaL_getsubtable in 5.3.5 -> 5.4 beta.
The manual still says these functions should be called with luaL_requiref:
http://www.lua.org/work/doc/manual.html#6
The list archive is littered with advice not to call luaopen_xxx
functions directly in C.
Now you can call them yourself if you want, but part of a
lua_CFunction contract is the returned int, which you blatantly ignore
in your demo code.