lua-users home
lua-l archive

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


On Wed, 19 Feb 2020 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.