mascarenhas/alien

test_alien.lua fails if Lua was compiled with LUA_USE_APICHECK

shmuz opened this issue · 2 comments

Running test_alien.lua by Lua compiled with LUA_USE_APICHECK fails:
Assertion failed: L->top < L->ci->top, file lapi.c, line 432

Here is a patch that seems to fix the problem:

--- core.c.old  Tue Sep 20 17:00:30 2011
+++ core.c  Thu Dec 01 12:05:26 2011
@@ -561,6 +561,7 @@
     break;
   default: luaL_error(ac->L, "alien: unknown return type in callback");
   }
+  lua_pop(ac->L, 1);
 }

 static int alien_callback_new(lua_State *L) {

Patch applied, commit c40c743.