diff options
Diffstat (limited to 'ltable.c')
| -rw-r--r-- | ltable.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 2.57 2011/05/31 18:27:56 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.58 2011/06/02 19:31:40 roberto Exp roberto $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -88,8 +88,9 @@ static Node *hashnum (const Table *t, lua_Number n) { | |||
| 88 | int i; | 88 | int i; |
| 89 | luai_hashnum(i, n); | 89 | luai_hashnum(i, n); |
| 90 | if (i < 0) { | 90 | if (i < 0) { |
| 91 | i = -i; /* must be a positive value */ | 91 | if ((unsigned int)i == -(unsigned int)i) |
| 92 | if (i < 0) i = 0; /* handle INT_MIN */ | 92 | i = 0; /* handle INT_MIN */ |
| 93 | i = -i; /* must be a positive value */ | ||
| 93 | } | 94 | } |
| 94 | return hashmod(t, i); | 95 | return hashmod(t, i); |
| 95 | } | 96 | } |
