diff options
| -rw-r--r-- | lobject.c | 9 |
1 files changed, 5 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.c,v 1.87 2002/09/02 19:54:49 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 1.88 2002/09/19 13:03:53 roberto Exp roberto $ |
| 3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -57,7 +57,8 @@ int luaO_log2 (unsigned int x) { | |||
| 57 | 57 | ||
| 58 | int luaO_rawequalObj (const TObject *t1, const TObject *t2) { | 58 | int luaO_rawequalObj (const TObject *t1, const TObject *t2) { |
| 59 | if (ttype(t1) != ttype(t2)) return 0; | 59 | if (ttype(t1) != ttype(t2)) return 0; |
| 60 | switch (ttype(t1)) { | 60 | if (iscollectable(t1)) return gcvalue(t1) == gcvalue(t2); |
| 61 | else switch (ttype(t1)) { | ||
| 61 | case LUA_TNIL: | 62 | case LUA_TNIL: |
| 62 | return 1; | 63 | return 1; |
| 63 | case LUA_TBOOLEAN: | 64 | case LUA_TBOOLEAN: |
| @@ -66,9 +67,9 @@ int luaO_rawequalObj (const TObject *t1, const TObject *t2) { | |||
| 66 | return pvalue(t1) == pvalue(t2); | 67 | return pvalue(t1) == pvalue(t2); |
| 67 | case LUA_TNUMBER: | 68 | case LUA_TNUMBER: |
| 68 | return nvalue(t1) == nvalue(t2); | 69 | return nvalue(t1) == nvalue(t2); |
| 69 | default: | ||
| 70 | return gcvalue(t1) == gcvalue(t2); | ||
| 71 | } | 70 | } |
| 71 | lua_assert(0); | ||
| 72 | return 0; /* to avoid warnings */ | ||
| 72 | } | 73 | } |
| 73 | 74 | ||
| 74 | 75 | ||
