aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-08-09 17:58:29 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-08-09 17:58:29 -0300
commit92afcf2823e5dfbe9bb10b0ed62306b6015fcfb8 (patch)
tree8e360f9491a5d547a8be1aaddce780adb9fcea6b /ldebug.c
parentb5bf7d9ef414ce05da8523b966d94252c32a4010 (diff)
downloadlua-92afcf2823e5dfbe9bb10b0ed62306b6015fcfb8.tar.gz
lua-92afcf2823e5dfbe9bb10b0ed62306b6015fcfb8.tar.bz2
lua-92afcf2823e5dfbe9bb10b0ed62306b6015fcfb8.zip
no more 'luaH_setstr (used only once) + 'luaH_setint' receives value
to be set.
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ldebug.c b/ldebug.c
index 9a0242b6..e57beff6 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 2.81 2011/04/28 14:00:11 roberto Exp roberto $ 2** $Id: ldebug.c,v 2.82 2011/06/02 19:31:40 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*/
@@ -190,12 +190,14 @@ static void collectvalidlines (lua_State *L, Closure *f) {
190 } 190 }
191 else { 191 else {
192 int i; 192 int i;
193 TValue v;
193 int *lineinfo = f->l.p->lineinfo; 194 int *lineinfo = f->l.p->lineinfo;
194 Table *t = luaH_new(L); 195 Table *t = luaH_new(L); /* new table to store active lines */
195 sethvalue(L, L->top, t); 196 sethvalue(L, L->top, t); /* push it on stack */
196 incr_top(L); 197 incr_top(L);
197 for (i=0; i<f->l.p->sizelineinfo; i++) 198 setbvalue(&v, 1); /* boolean 'true' to be the value of all indices */
198 setbvalue(luaH_setint(L, t, lineinfo[i]), 1); 199 for (i = 0; i < f->l.p->sizelineinfo; i++) /* for all lines with code */
200 luaH_setint(L, t, lineinfo[i], &v); /* table[line] = true */
199 } 201 }
200} 202}
201 203