[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luaL_buffinit stack manipulation
- From: Benoit Germain <bnt.germain@...>
- Date: Thu, 8 Jul 2021 11:02:00 +0200
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 :-(.
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.