[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua5.4-beta luaopen_package leaves CLIBS table on stack
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Thu, 20 Feb 2020 07:56:54 +0000
On Wed, 19 Feb 2020 at 23:49, Stefan <email@example.com> 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:
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.