diff options
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 20 |
1 files changed, 10 insertions, 10 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 1.156 2003/10/02 19:21:09 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 1.157 2003/10/20 18:42:28 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 | */ |
| @@ -136,7 +136,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { | |||
| 136 | if (!name || name[0] == '(') /* `(' starts private locals */ | 136 | if (!name || name[0] == '(') /* `(' starts private locals */ |
| 137 | name = NULL; | 137 | name = NULL; |
| 138 | else | 138 | else |
| 139 | setobjs2s(ci->base+(n-1), L->top); | 139 | setobjs2s(L, ci->base+(n-1), L->top); |
| 140 | } | 140 | } |
| 141 | lua_unlock(L); | 141 | lua_unlock(L); |
| 142 | return name; | 142 | return name; |
| @@ -196,7 +196,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, | |||
| 196 | break; | 196 | break; |
| 197 | } | 197 | } |
| 198 | case 'f': { | 198 | case 'f': { |
| 199 | setobj2s(L->top, f); | 199 | setobj2s(L, L->top, f); |
| 200 | break; | 200 | break; |
| 201 | } | 201 | } |
| 202 | default: status = 0; /* invalid option */ | 202 | default: status = 0; /* invalid option */ |
| @@ -484,7 +484,7 @@ static const char *getfuncname (CallInfo *ci, const char **name) { | |||
| 484 | 484 | ||
| 485 | 485 | ||
| 486 | /* only ANSI way to check whether a pointer points to an array */ | 486 | /* only ANSI way to check whether a pointer points to an array */ |
| 487 | static int isinstack (CallInfo *ci, const TObject *o) { | 487 | static int isinstack (CallInfo *ci, const TValue *o) { |
| 488 | StkId p; | 488 | StkId p; |
| 489 | for (p = ci->base; p < ci->top; p++) | 489 | for (p = ci->base; p < ci->top; p++) |
| 490 | if (o == p) return 1; | 490 | if (o == p) return 1; |
| @@ -492,7 +492,7 @@ static int isinstack (CallInfo *ci, const TObject *o) { | |||
| 492 | } | 492 | } |
| 493 | 493 | ||
| 494 | 494 | ||
| 495 | void luaG_typeerror (lua_State *L, const TObject *o, const char *op) { | 495 | void luaG_typeerror (lua_State *L, const TValue *o, const char *op) { |
| 496 | const char *name = NULL; | 496 | const char *name = NULL; |
| 497 | const char *t = luaT_typenames[ttype(o)]; | 497 | const char *t = luaT_typenames[ttype(o)]; |
| 498 | const char *kind = (isinstack(L->ci, o)) ? | 498 | const char *kind = (isinstack(L->ci, o)) ? |
| @@ -512,15 +512,15 @@ void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { | |||
| 512 | } | 512 | } |
| 513 | 513 | ||
| 514 | 514 | ||
| 515 | void luaG_aritherror (lua_State *L, const TObject *p1, const TObject *p2) { | 515 | void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) { |
| 516 | TObject temp; | 516 | TValue temp; |
| 517 | if (luaV_tonumber(p1, &temp) == NULL) | 517 | if (luaV_tonumber(p1, &temp) == NULL) |
| 518 | p2 = p1; /* first operand is wrong */ | 518 | p2 = p1; /* first operand is wrong */ |
| 519 | luaG_typeerror(L, p2, "perform arithmetic on"); | 519 | luaG_typeerror(L, p2, "perform arithmetic on"); |
| 520 | } | 520 | } |
| 521 | 521 | ||
| 522 | 522 | ||
| 523 | int luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2) { | 523 | int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) { |
| 524 | const char *t1 = luaT_typenames[ttype(p1)]; | 524 | const char *t1 = luaT_typenames[ttype(p1)]; |
| 525 | const char *t2 = luaT_typenames[ttype(p2)]; | 525 | const char *t2 = luaT_typenames[ttype(p2)]; |
| 526 | if (t1[2] == t2[2]) | 526 | if (t1[2] == t2[2]) |
| @@ -546,8 +546,8 @@ void luaG_errormsg (lua_State *L) { | |||
| 546 | if (L->errfunc != 0) { /* is there an error handling function? */ | 546 | if (L->errfunc != 0) { /* is there an error handling function? */ |
| 547 | StkId errfunc = restorestack(L, L->errfunc); | 547 | StkId errfunc = restorestack(L, L->errfunc); |
| 548 | if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); | 548 | if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); |
| 549 | setobjs2s(L->top, L->top - 1); /* move argument */ | 549 | setobjs2s(L, L->top, L->top - 1); /* move argument */ |
| 550 | setobjs2s(L->top - 1, errfunc); /* push function */ | 550 | setobjs2s(L, L->top - 1, errfunc); /* push function */ |
| 551 | incr_top(L); | 551 | incr_top(L); |
| 552 | luaD_call(L, L->top - 2, 1); /* call it */ | 552 | luaD_call(L, L->top - 2, 1); /* call it */ |
| 553 | } | 553 | } |
