Skip to content

Commit 8db8ca1

Browse files
committed
Fix pjwHash64 to generate 64-bit Longs
Previously the constants where set to generate 32-bit ints.
1 parent 3ddfa3c commit 8db8ca1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ class TastyPickler(val rootCls: ClassSymbol) {
8282
var i = 0
8383
while (i < data.length) {
8484
val d = data(i) & 0xFFL // Interpret byte as unsigned byte
85-
h = (h << 4) + d
86-
val high = h & 0xF0000000L
87-
if (high != 0)
88-
h ^= high >> 24
89-
h &= ~high
85+
h = (h << 8) + d
86+
val high = h & 0xFF00000000000000L
87+
if (high != 0) {
88+
h ^= high >> 48L
89+
h &= ~high
90+
}
9091
i += 1
9192
}
9293
h

0 commit comments

Comments
 (0)