diff options
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.28 2005/11/01 16:08:52 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.29 2005/12/22 16:19:56 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 | */ |
@@ -128,8 +128,10 @@ LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { | |||
128 | CallInfo *ci = L->base_ci + ar->i_ci; | 128 | CallInfo *ci = L->base_ci + ar->i_ci; |
129 | const char *name = findlocal(L, ci, n); | 129 | const char *name = findlocal(L, ci, n); |
130 | lua_lock(L); | 130 | lua_lock(L); |
131 | if (name) | 131 | if (name) { |
132 | luaA_pushobject(L, ci->base + (n - 1)); | 132 | setobj2s(L, L->top, ci->base + (n - 1)); |
133 | api_incr_top(L); | ||
134 | } | ||
133 | lua_unlock(L); | 135 | lua_unlock(L); |
134 | return name; | 136 | return name; |
135 | } | 137 | } |
@@ -177,16 +179,17 @@ static void info_tailcall (lua_Debug *ar) { | |||
177 | static void collectvalidlines (lua_State *L, Closure *f) { | 179 | static void collectvalidlines (lua_State *L, Closure *f) { |
178 | if (f == NULL || f->c.isC) { | 180 | if (f == NULL || f->c.isC) { |
179 | setnilvalue(L->top); | 181 | setnilvalue(L->top); |
182 | incr_top(L); | ||
180 | } | 183 | } |
181 | else { | 184 | else { |
182 | Table *t = luaH_new(L, 0, 0); | ||
183 | int *lineinfo = f->l.p->lineinfo; | ||
184 | int i; | 185 | int i; |
186 | int *lineinfo = f->l.p->lineinfo; | ||
187 | Table *t = luaH_new(L); | ||
188 | sethvalue(L, L->top, t); | ||
189 | incr_top(L); | ||
185 | for (i=0; i<f->l.p->sizelineinfo; i++) | 190 | for (i=0; i<f->l.p->sizelineinfo; i++) |
186 | setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); | 191 | setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); |
187 | sethvalue(L, L->top, t); | ||
188 | } | 192 | } |
189 | incr_top(L); | ||
190 | } | 193 | } |
191 | 194 | ||
192 | 195 | ||