[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Problems with lua_getstack
- From: "Curt Carpenter" <curtc@...>
- Date: Fri, 31 May 2002 11:59:54 -0700
I am attempting to call lua_getstack in an error hook. I have a simple
function that I call, something like this:
The error hook fires as expected, and the message tells me exactly what
I would expect: "attempt to call global `notafunction' (a nil value)".
So far so good.
But now I want to get info about the function, so I have a while
(lua_getstack(l, level, &ar)) loop. Problem is, even when level is 0,
lua_getstack returns 0. I was wondering whether the line in lua_getstack
if (L->ci - L->base_ci <= level) status = 0; /* there is no such
was supposed to have a < instead of <=. But that doesn't appear to be
the case since the subsequent call to lua_getinfo errors out ("value for
`lua_getinfo' is not a function").