diff options
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -52,6 +52,7 @@ | |||
52 | #define hashnum(t,n) \ | 52 | #define hashnum(t,n) \ |
53 | (node(t, lmod(cast(lu_hash, cast(ls_hash, n)), sizenode(t)))) | 53 | (node(t, lmod(cast(lu_hash, cast(ls_hash, n)), sizenode(t)))) |
54 | #define hashstr(t,str) (node(t, lmod((str)->tsv.hash, sizenode(t)))) | 54 | #define hashstr(t,str) (node(t, lmod((str)->tsv.hash, sizenode(t)))) |
55 | #define hashboolean(t,p) (node(t, lmod(p, sizenode(t)))) | ||
55 | #define hashpointer(t,p) (node(t, lmod(IntPoint(p), sizenode(t)))) | 56 | #define hashpointer(t,p) (node(t, lmod(IntPoint(p), sizenode(t)))) |
56 | 57 | ||
57 | 58 | ||
@@ -65,6 +66,8 @@ Node *luaH_mainposition (const Table *t, const TObject *key) { | |||
65 | return hashnum(t, nvalue(key)); | 66 | return hashnum(t, nvalue(key)); |
66 | case LUA_TSTRING: | 67 | case LUA_TSTRING: |
67 | return hashstr(t, tsvalue(key)); | 68 | return hashstr(t, tsvalue(key)); |
69 | case LUA_TBOOLEAN: | ||
70 | return hashboolean(t, bvalue(key)); | ||
68 | default: /* all other types are hashed as (void *) */ | 71 | default: /* all other types are hashed as (void *) */ |
69 | return hashpointer(t, tsvalue(key)); | 72 | return hashpointer(t, tsvalue(key)); |
70 | } | 73 | } |