aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-12-01 14:31:04 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-12-01 14:31:04 -0200
commit513d0258d9d6ec5b52efc612ebc52aa5161c23fa (patch)
tree8098471e32764a8d9c3428ffb70ead24434f60cd
parentcfa8bc3ca4befd1df216d8007b8557da2976f359 (diff)
downloadlua-513d0258d9d6ec5b52efc612ebc52aa5161c23fa.tar.gz
lua-513d0258d9d6ec5b52efc612ebc52aa5161c23fa.tar.bz2
lua-513d0258d9d6ec5b52efc612ebc52aa5161c23fa.zip
details
-rw-r--r--ldebug.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ldebug.c b/ldebug.c
index b9010bea..76afe3c3 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 2.58 2009/11/25 15:27:51 roberto Exp roberto $ 2** $Id: ldebug.c,v 2.59 2009/11/26 15:34:15 roberto Exp roberto $
3** Debug Interface 3** Debug Interface
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -52,7 +52,8 @@ LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {
52 mask = 0; 52 mask = 0;
53 func = NULL; 53 func = NULL;
54 } 54 }
55 L->oldpc = NULL; 55 if (isLua(L->ci))
56 L->oldpc = L->ci->u.l.savedpc;
56 L->hook = func; 57 L->hook = func;
57 L->basehookcount = count; 58 L->basehookcount = count;
58 resethookcount(L); 59 resethookcount(L);
@@ -107,7 +108,10 @@ static const char *findlocal (lua_State *L, CallInfo *ci, int n,
107 StkId limit = (ci == L->ci) ? L->top : ci->next->func; 108 StkId limit = (ci == L->ci) ? L->top : ci->next->func;
108 if (limit - base >= n && n > 0) /* is 'n' inside 'ci' stack? */ 109 if (limit - base >= n && n > 0) /* is 'n' inside 'ci' stack? */
109 name = "(*temporary)"; /* generic name for any valid slot */ 110 name = "(*temporary)"; /* generic name for any valid slot */
110 else return NULL; /* no name */ 111 else {
112 *pos = base; /* to avoid warnings */
113 return NULL; /* no name */
114 }
111 } 115 }
112 *pos = base + (n - 1); 116 *pos = base + (n - 1);
113 return name; 117 return name;