[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Stack level doesn't match hook events
- From: Rici Lake <lua@...>
- Date: Sat, 18 Sep 2004 08:33:48 -0500
On 18-Sep-04, at 3:06 AM, Tom Spilman wrote:
To wrap this thread up. What seemed like the right thing to do, count
LUA_HOOKCALLs to keep track of the stack depth, is a bad idea. First
because LUA_HOOKCALL changes meaning when it's a tail call as the stack
depth doesn't change (how about a LUA_HOOKTAILCALL?).
Yes. LUA_HOOKTAILCALL was precisely my suggestion; then you can add one
on LUA_HOOKCALL, subtract one on LUA_HOOKRETURN, and do nothing on
LUA_HOOKTAILCALL.
However, there are other events that change call stack depth, such as
error()/pcall() and yield()/resume().