From 5a0f68999ee6972f535fd18cf2492c1fea478c15 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Fri, 14 Jun 2019 11:04:20 +0800 Subject: [PATCH] fix #1032 --- 3rd/lua/lstring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3rd/lua/lstring.c b/3rd/lua/lstring.c index b130682f..20bc9f5d 100644 --- a/3rd/lua/lstring.c +++ b/3rd/lua/lstring.c @@ -445,7 +445,7 @@ mergeset(struct ssm_ref *set, struct ssm_ref * rset, int changeref) { static void merge_last(struct collect_queue * c) { void *key = c->key; - int hash = (int)((uintptr_t)key % VMHASHSLOTS); + int hash = (int)((size_t)key % VMHASHSLOTS); struct shrmap * s = &SSM; struct collect_queue * slot = s->vm[hash]; if (slot == NULL) { @@ -485,7 +485,7 @@ merge_last(struct collect_queue * c) { static void clear_vm(struct collect_queue * c) { void *key = c->key; - int hash = (int)((uintptr_t)key % VMHASHSLOTS); + int hash = (int)((size_t)key % VMHASHSLOTS); struct shrmap * s = &SSM; struct collect_queue * slot = s->vm[hash]; lua_assert(slot == c);