the Deref and DerefMut impls previously always read from the index -1, which would be incorrect if the userdata were stored elsewhere. This adds an index field to UserdataOnStack which is filled in when it is created in lua_read_at_position, so that the value is always read from the correct position. This allows having userdata in function arguments aside from the first, for example.
the
Deref
andDerefMut
impls previously always read from the index -1, which would be incorrect if the userdata were stored elsewhere. This adds anindex
field toUserdataOnStack
which is filled in when it is created inlua_read_at_position
, so that the value is always read from the correct position. This allows having userdata in function arguments aside from the first, for example.