Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua stack index bug #54

Open
BigJim opened this issue Feb 14, 2017 · 0 comments
Open

Lua stack index bug #54

BigJim opened this issue Feb 14, 2017 · 0 comments

Comments

@BigJim
Copy link

BigJim commented Feb 14, 2017

In "alien.c" in "alien_buffer_gc" @ line #934:
"lua_pop(L, 2);"
When "LUA_USE_APICHECK" is defined, this line will trigger a "invalid new top".

This because there is only one stack index (the __gc userdata argument) not two.
And actually since there is no return result this call is pointless.
The solution is to just delete this unnecessary "lua_pop(L, 2);" line.

Note to readers: In your debug Lua builds that use 3rd party libraries, it's a good idea to define LUA_USE_APICHECK as it will catch odd things like this that corrupt your Lua stack, Lua stack overflows, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant