LJ_GC64: Fix ir_khash for non-string GCobj.

Contributed by Peter Cawley.
This commit is contained in:
Mike Pall 2017-10-02 09:22:46 +02:00
parent 6a2d8b0b4d
commit b4ed3219a1

View File

@ -1017,7 +1017,11 @@ static uint32_t ir_khash(IRIns *ir)
} else { } else {
lua_assert(irt_isgcv(ir->t)); lua_assert(irt_isgcv(ir->t));
lo = u32ptr(ir_kgc(ir)); 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; hi = lo + HASH_BIAS;
#endif
} }
return hashrot(lo, hi); return hashrot(lo, hi);
} }