[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Acceptable indicies
- From: liam mail <liam.list@...>
- Date: Tue, 30 Aug 2011 11:37:08 +0100
"Most query functions accept as indices any value inside the available
stack space ..." 
Would it be correct to say, "all functions which take a stack index
require that it is inside the available stack space", or are there
exceptions to this? I ask because functions such luaL_opt* and
luaL_check*  do not mention they require acceptable indicies and
ones which are not acceptable result in undefined behaviour, whilst
nearly all other functions that take indicies are noted they have a
precondition of an acceptable index.
if lua_gettop equals 0
luaL_checkany(L,-1) is undefined.
or when stackspace equals X
luaL_checkany(L,X+1) is undefined.