lua-users home
lua-l archive

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


Even weider: sometimes, lua_dump will replace the dumped closure at the top of the stack with a full userdata, instead of leaving the stack unchanged. All in all, this means that code using lua_dump that works just fine with Lua 5.3 and below can break in many interesting ways when compiled and run against Lua 5.4 :-(.

Le jeu. 8 juil. 2021 à 10:03, Benoit Germain <bnt.germain@gmail.com> a écrit :
Hello,

I've just discovered that in Lua 5.4.3, luaL_buffinit pushes a light userdata on the stack, which it did not do in previous versions.

However, the documentation for the function is [-0, +0, –] , meaning we should not expect anything to be pushed on the stack, nor any error raised. Also, API incompatibility doesn't say anything about it either.

Is there a practical reason for the behavior change? In any event, I suppose the documentation should be fixed.

Regards,

--

Benoit.


--
Benoit.