lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm having some stack underflow problems; I'm not sure if it's something I'm
doing wrong, or a bug in 5.0 alpha.

I'm using the following to execute a string:

  lua_dobuffer(L, cmd, strlen(cmd), NULL);

If the string is unrecognised, then it fails the lua_loadstring(), and calls
callalert() with status != 0.

On entry to this function, there is a single item on the stack (an error
string, I guess), this does the following:

lua_getglobal(L, "_ALERT");
lua_insert(L, -2);
lua_call(L, 1, 0);
lua_pop(L, 1);


_ALERT is successfully called, and displays an error, but having been called
with 0 return values, and having had no spare values on the stack
previously, the lua_pop(L, 1) seems to be effectively underflowing the
stack.

Am I missing something here, or is this a bug?

Thanks!

Love, Light and Peace,
- Peter Loveday
Director of Development, eyeon Software