lua-users home
lua-l archive

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


> >>>>> "Roberto" == Roberto Ierusalimschy <roberto@inf.puc-rio.br> writes:
> 
>  Luiz> Lua 5.4.3 (rc1) is now available for testing at
>  Luiz> http://www.lua.org/work/lua-5.4.3-rc1.tar.gz
> 
>  >> This changes the API incompatibly in a minor revision.
> 
>  Roberto> Whould you mind explaining?
> 
> Code written for 5.4.2 expects lua_pop / lua_settop to close variables,
> but as soon as you load it with a 5.4.3 binary or .so, that stops
> happening and the code no longer behaves correctly (if you build lua
> with asserts you can get an assert failure, I haven't explored what can
> happen without asserts but I bet it's possible for it to crash).

Probably we should have put LUA_COMPAT_5_4_0 on by default.

I don't see how that error could crash Lua. It probably would raise
an error that the object being closed does not have a __closing method.
If that can really crash Lua, the check should probably be always
on, as this seems a quite common error for one to make. Maybe the
function could always raise a normal error when popping an active
to-be-closed variable?

Our thinking in this change is that probably very few people are already
using to-be-closed variables in the C API, so this change would affect
very few people. To wait for 5.5 for this change (in particular for
adding lua_closeslot) would make the incompatibility more troubling.

-- Roberto