aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-18 13:59:09 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-18 13:59:09 -0200
commitf2c451d7455aad3496f32dfa2bfca7f7e8b5376d (patch)
tree38e30f839516ff5b6178351750b5e3256f4dd98e /ldebug.c
parent619edfd9e4c210bdfcfbf1e911d1760c53c4293f (diff)
downloadlua-f2c451d7455aad3496f32dfa2bfca7f7e8b5376d.tar.gz
lua-f2c451d7455aad3496f32dfa2bfca7f7e8b5376d.tar.bz2
lua-f2c451d7455aad3496f32dfa2bfca7f7e8b5376d.zip
all accesses to TObjects done through macros
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ldebug.c b/ldebug.c
index b3cc80d8..c0969359 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.51 2000/11/30 18:50:47 roberto Exp roberto $ 2** $Id: ldebug.c,v 1.52 2000/12/26 18:46:09 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*/
@@ -29,10 +29,9 @@ static const char *getfuncname (lua_State *L, StkId f, const char **name);
29 29
30static void setnormalized (TObject *d, const TObject *s) { 30static void setnormalized (TObject *d, const TObject *s) {
31 if (ttype(s) == LUA_TMARK) { 31 if (ttype(s) == LUA_TMARK) {
32 clvalue(d) = infovalue(s)->func; 32 setclvalue(d, infovalue(s)->func);
33 ttype(d) = LUA_TFUNCTION;
34 } 33 }
35 else *d = *s; 34 else setobj(d, s);
36} 35}
37 36
38 37
@@ -58,7 +57,7 @@ LUA_API lua_Hook lua_setlinehook (lua_State *L, lua_Hook func) {
58static StkId aux_stackedfunction (lua_State *L, int level, StkId top) { 57static StkId aux_stackedfunction (lua_State *L, int level, StkId top) {
59 int i; 58 int i;
60 for (i = (top-1) - L->stack; i>=0; i--) { 59 for (i = (top-1) - L->stack; i>=0; i--) {
61 if (is_T_MARK(L->stack[i].ttype)) { 60 if (is_T_MARK(&L->stack[i])) {
62 if (level == 0) 61 if (level == 0)
63 return L->stack+i; 62 return L->stack+i;
64 level--; 63 level--;
@@ -168,7 +167,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
168 if (!fp) return NULL; /* `f' is not a Lua function? */ 167 if (!fp) return NULL; /* `f' is not a Lua function? */
169 name = luaF_getlocalname(fp, n, currentpc(f)); 168 name = luaF_getlocalname(fp, n, currentpc(f));
170 if (!name || name[0] == '(') return NULL; /* `(' starts private locals */ 169 if (!name || name[0] == '(') return NULL; /* `(' starts private locals */
171 *((f+1)+(n-1)) = *L->top; 170 setobj((f+1)+(n-1), L->top);
172 return name; 171 return name;
173} 172}
174 173