alien icon indicating copy to clipboard operation
alien copied to clipboard

Lua stack index bug

Open BigJim opened this issue 8 years ago • 0 comments

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.

BigJim avatar Feb 14 '17 19:02 BigJim