diff options
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -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 | ||
| 30 | static void setnormalized (TObject *d, const TObject *s) { | 30 | static 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) { | |||
| 58 | static StkId aux_stackedfunction (lua_State *L, int level, StkId top) { | 57 | static 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 | ||
