From f94cd2201c3a8d341db448f2719dfb0ae4338adf Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 26 Aug 2008 10:27:42 -0300 Subject: better control of call status through CallInfo --- lstate.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index b34bb163..c4106562 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.34 2008/06/26 19:42:45 roberto Exp roberto $ +** $Id: lstate.h,v 2.35 2008/08/13 17:01:33 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -82,16 +82,23 @@ typedef struct CallInfo { StkId top; /* top for this function */ const Instruction *savedpc; short nresults; /* expected number of results from this function */ - lu_byte status; + lu_byte callstatus; int tailcalls; /* number of tail calls lost under this entry */ } CallInfo; +/* +** Bits in CallInfo status +*/ +#define CIST_LUA 1 /* call is running a Lua function */ +#define CIST_HOOKED 2 /* call is running a debug hook */ +#define CIST_REENTRY 4 /* call is running on same invocation of + luaV_execute of previous call */ + #define curr_func(L) (clvalue(L->ci->func)) #define ci_func(ci) (clvalue((ci)->func)) -#define f_isLua(ci) (!ci_func(ci)->c.isC) -#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci)) +#define isLua(ci) ((ci)->callstatus & CIST_LUA) /* -- cgit v1.2.3-55-g6feb