Skip to content
Discussion options

You must be logged in to vote

Codex says you can fix it like this:

`addConverter` only affects conversion when reading Lua userdata as another C++ type. It does not convert C++ return values before pushing them to Lua.

Since `Texture::getSize()` returns `Vector2u`, add a `Stack<Vector2u>` specialization that forwards `push/get/isInstance` through `Stack<Vector2f>`. Do the same for `Vector2i`.

Codex also says to the maintainer:

There is also a stack-integrity issue in `UserdataValue<T>::place()`: it allocates userdata before checking whether `T` is registered. On failure, it destroys the wrapper but leaves the userdata on the Lua stack.

The registration lookup should happen before `lua_newuserdata`, with a regressio…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@3lyrion
Comment options

Answer selected by 3lyrion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants