Blob Blame History Raw
From b4ed3219a1a98dd9fe7d1e3eeea3b82f5a780948 Mon Sep 17 00:00:00 2001
From: Mike Pall <mike>
Date: Mon, 2 Oct 2017 09:22:46 +0200
Subject: [PATCH 17/72] LJ_GC64: Fix ir_khash for non-string GCobj.

Contributed by Peter Cawley.
---
 src/lj_asm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lj_asm.c b/src/lj_asm.c
index bed2268..d961927 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -1017,7 +1017,11 @@ static uint32_t ir_khash(IRIns *ir)
   } else {
     lua_assert(irt_isgcv(ir->t));
     lo = u32ptr(ir_kgc(ir));
+#if LJ_GC64
+    hi = (uint32_t)(u64ptr(ir_kgc(ir)) >> 32) | (irt_toitype(ir->t) << 15);
+#else
     hi = lo + HASH_BIAS;
+#endif
   }
   return hashrot(lo, hi);
 }
-- 
2.20.1