diff options
author | Emil Renner Berthing <esmil@mailme.dk> | 2012-07-15 01:06:01 +0200 |
---|---|---|
committer | Emil Renner Berthing <esmil@mailme.dk> | 2012-07-23 17:36:24 +0200 |
commit | 78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe (patch) | |
tree | d9e476dfee06bf8ba6dcf4499fb78ce1350728fe /lua/ldebug.c | |
parent | 3a1c6f4e205c8c6d28abc641e568f2fa6362c654 (diff) | |
download | lem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.tar.gz lem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.tar.xz lem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.zip |
Lua 5.2.1
Diffstat (limited to 'lua/ldebug.c')
-rw-r--r-- | lua/ldebug.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lua/ldebug.c b/lua/ldebug.c index 31b7ae4..43f8f04 100644 --- a/lua/ldebug.c +++ b/lua/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.88 2011/11/30 12:43:51 roberto Exp $ +** $Id: ldebug.c,v 2.89 2012/01/20 22:05:50 roberto Exp $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -30,6 +30,9 @@ +#define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_TCCL) + + static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); @@ -173,7 +176,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { static void funcinfo (lua_Debug *ar, Closure *cl) { - if (cl == NULL || cl->c.isC) { + if (noLuaClosure(cl)) { ar->source = "=[C]"; ar->linedefined = -1; ar->lastlinedefined = -1; @@ -191,7 +194,7 @@ static void funcinfo (lua_Debug *ar, Closure *cl) { static void collectvalidlines (lua_State *L, Closure *f) { - if (f == NULL || f->c.isC) { + if (noLuaClosure(f)) { setnilvalue(L->top); incr_top(L); } @@ -210,7 +213,7 @@ static void collectvalidlines (lua_State *L, Closure *f) { static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, - Closure *f, CallInfo *ci) { + Closure *f, CallInfo *ci) { int status = 1; for (; *what; what++) { switch (*what) { @@ -224,7 +227,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, } case 'u': { ar->nups = (f == NULL) ? 0 : f->c.nupvalues; - if (f == NULL || f->c.isC) { + if (noLuaClosure(f)) { ar->isvararg = 1; ar->nparams = 0; } |