lua-users home
lua-l archive

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


I'm getting an intermitant crash in Lua 5 Beta attempting to retrieve an
upvalue that does not exist.


The code that is a problem in this case is:

    ptr = lua_touserdata(L, lua_upvalueindex(2))

I only have 1 upvalue in this case (though at times I might have 2); I had
assumed this would return NULL, but it doesn't seem to do so reliably.

Is there a fix for this, or, alternatively, can I tell how many upvalues I
was passed so as to prevent my code querying the second value if it isn't
present?

Thanks!


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