lua-users home
lua-l archive

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

Title: Message
I have this weird situation that's reproable (but not in a nice tidy sample), where when I call lua_call(l, 1, LUA_MULTRET); it usually works just fine, but sometimes when the lua function (which is a true lua function, not a registered C function) returns with no return values, I call lua_gettop and it returns 1. If I look at the item on the stack, lua_gettype = LUA_TNUMBER and lua_tonumber = 0. But there shouldn't be anything on the stack at this point.
I haven't started digging through Lua source yet, but I thought I'd fire this off hoping someone has seen this and knows what the deal is. Alternatively, I suppose I could return nil and check for that, and hope that this problem only affects functions that don't return any values. But that's really kludgy, and may impact cases where I really do want to return nil as being distinctly different from returning nothing.