[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: luaL_checkudata for invalid index?
- From: Marc Lepage <mlepage@...>
- Date: Thu, 21 Feb 2013 15:49:12 -0500
Apologies for another silly little question.
In C code, for 5.1, if I call luaL_checkudata but the index doesn't exist (say I was expecting an arg but none was provided), is that OK (and I get expected failure) or is that somehow bad or undefined?
The docs just say:
luaL_checkudata: Checks whether the function argument
is a userdata
of the type
In the implementation, I can see it calls:
lua_touserdata: If the value at the given acceptable index is a full userdata,
returns its block address.
If the value is a light userdata,
returns its pointer.
So I guess my question is whether, if I was expecting an arg and it wasn't provided, is that an "acceptable index?" (Or, if it's not acceptable, that's the "otherwise" clause?)