diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-08-16 14:34:28 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-08-16 14:34:28 -0300 |
commit | a3e1c40d6d6fb81db9d8b58aee69466f715aab5c (patch) | |
tree | ea11a028d8d92772ad97879c7bc5bbe50318bbea /ldebug.c | |
parent | c1a2a646c81000b03a243cbdeba9c4bd6dd7b474 (diff) | |
download | lua-a3e1c40d6d6fb81db9d8b58aee69466f715aab5c.tar.gz lua-a3e1c40d6d6fb81db9d8b58aee69466f715aab5c.tar.bz2 lua-a3e1c40d6d6fb81db9d8b58aee69466f715aab5c.zip |
remove of unecessary luaD_checkstack. (In some cases, C should
ensure stack space; in others, Lua can use the extra slots for
temporary values.)
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.88 2011/11/30 12:43:51 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.89 2012/01/20 22:05:50 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 | */ |
@@ -196,7 +196,7 @@ static void funcinfo (lua_Debug *ar, Closure *cl) { | |||
196 | static void collectvalidlines (lua_State *L, Closure *f) { | 196 | static void collectvalidlines (lua_State *L, Closure *f) { |
197 | if (noLuaClosure(f)) { | 197 | if (noLuaClosure(f)) { |
198 | setnilvalue(L->top); | 198 | setnilvalue(L->top); |
199 | incr_top(L); | 199 | api_incr_top(L); |
200 | } | 200 | } |
201 | else { | 201 | else { |
202 | int i; | 202 | int i; |
@@ -204,7 +204,7 @@ static void collectvalidlines (lua_State *L, Closure *f) { | |||
204 | int *lineinfo = f->l.p->lineinfo; | 204 | int *lineinfo = f->l.p->lineinfo; |
205 | Table *t = luaH_new(L); /* new table to store active lines */ | 205 | Table *t = luaH_new(L); /* new table to store active lines */ |
206 | sethvalue(L, L->top, t); /* push it on stack */ | 206 | sethvalue(L, L->top, t); /* push it on stack */ |
207 | incr_top(L); | 207 | api_incr_top(L); |
208 | setbvalue(&v, 1); /* boolean 'true' to be the value of all indices */ | 208 | setbvalue(&v, 1); /* boolean 'true' to be the value of all indices */ |
209 | for (i = 0; i < f->l.p->sizelineinfo; i++) /* for all lines with code */ | 209 | for (i = 0; i < f->l.p->sizelineinfo; i++) /* for all lines with code */ |
210 | luaH_setint(L, t, lineinfo[i], &v); /* table[line] = true */ | 210 | luaH_setint(L, t, lineinfo[i], &v); /* table[line] = true */ |
@@ -285,7 +285,7 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { | |||
285 | status = auxgetinfo(L, what, ar, cl, ci); | 285 | status = auxgetinfo(L, what, ar, cl, ci); |
286 | if (strchr(what, 'f')) { | 286 | if (strchr(what, 'f')) { |
287 | setobjs2s(L, L->top, func); | 287 | setobjs2s(L, L->top, func); |
288 | incr_top(L); | 288 | api_incr_top(L); |
289 | } | 289 | } |
290 | if (strchr(what, 'L')) | 290 | if (strchr(what, 'L')) |
291 | collectvalidlines(L, cl); | 291 | collectvalidlines(L, cl); |
@@ -563,7 +563,7 @@ l_noret luaG_errormsg (lua_State *L) { | |||
563 | if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); | 563 | if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); |
564 | setobjs2s(L, L->top, L->top - 1); /* move argument */ | 564 | setobjs2s(L, L->top, L->top - 1); /* move argument */ |
565 | setobjs2s(L, L->top - 1, errfunc); /* push function */ | 565 | setobjs2s(L, L->top - 1, errfunc); /* push function */ |
566 | incr_top(L); | 566 | L->top++; |
567 | luaD_call(L, L->top - 2, 1, 0); /* call it */ | 567 | luaD_call(L, L->top - 2, 1, 0); /* call it */ |
568 | } | 568 | } |
569 | luaD_throw(L, LUA_ERRRUN); | 569 | luaD_throw(L, LUA_ERRRUN); |