[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Wrong condition at the beginning of luaL_unref ?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 13 Nov 2013 09:47:54 -0200
> Shouldn't there be a luai_apicheck(L, ref != 0) at the beginning of
> luaL_unref ?
'luai_apicheck' is defined only inside the Lua kernel; it cannot be
used in the auxlib. There could be something similar, but it does not
sound very useful to me. Most other functions in the auxlib also do
not check their parameters, and even the kernel API does not check
for more obvious errors, such as L==NULL. (Many API errors in C are
uncheckable, for instance checking whether the state L being passed to
an API function was closed.)