diff options
| -rw-r--r-- | lapi.c | 10 |
1 files changed, 3 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 1.24 1998/03/09 21:49:52 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.25 1998/06/05 22:17:44 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -173,12 +173,8 @@ lua_Object lua_rawgettable (void) | |||
| 173 | if (ttype(L->stack.top-2) != LUA_T_ARRAY) | 173 | if (ttype(L->stack.top-2) != LUA_T_ARRAY) |
| 174 | lua_error("indexed expression not a table in rawgettable"); | 174 | lua_error("indexed expression not a table in rawgettable"); |
| 175 | else { | 175 | else { |
| 176 | TObject *h = luaH_get(avalue(L->stack.top-2), L->stack.top-1); | 176 | *(L->stack.top-2) = *luaH_get(avalue(L->stack.top-2), L->stack.top-1); |
| 177 | --L->stack.top; | 177 | --L->stack.top; |
| 178 | if (h != NULL) | ||
| 179 | *(L->stack.top-1) = *h; | ||
| 180 | else | ||
| 181 | ttype(L->stack.top-1) = LUA_T_NIL; | ||
| 182 | } | 178 | } |
| 183 | return put_luaObjectonTop(); | 179 | return put_luaObjectonTop(); |
| 184 | } | 180 | } |
| @@ -426,7 +422,7 @@ void lua_settag (int tag) | |||
| 426 | break; | 422 | break; |
| 427 | default: | 423 | default: |
| 428 | luaL_verror("cannot change the tag of a %.20s", | 424 | luaL_verror("cannot change the tag of a %.20s", |
| 429 | luaO_typenames[-ttype((L->stack.top-1))]); | 425 | luaO_typename(L->stack.top-1)); |
| 430 | } | 426 | } |
| 431 | L->stack.top--; | 427 | L->stack.top--; |
| 432 | } | 428 | } |
