Skip to content

Commit bd41bee

Browse files
committed
Assemble buffer before computing the hash
Previously we where computing the hash for nameBuffer on an empty array.
1 parent 390d987 commit bd41bee

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ class TastyPickler(val rootCls: ClassSymbol) {
2020
sections += ((nameBuffer.nameIndex(name.toTermName), buf))
2121

2222
def assembleParts(): Array[Byte] = {
23-
def lengthWithLength(buf: TastyBuffer) = {
24-
buf.assemble()
23+
def lengthWithLength(buf: TastyBuffer) =
2524
buf.length + natSize(buf.length)
26-
}
25+
26+
nameBuffer.assemble()
27+
sections.foreach(_._2.assemble())
2728

2829
val uuidLow: Long = pjwHash64(nameBuffer.bytes)
2930
val uuidHi: Long = sections.iterator.map(x => pjwHash64(x._2.bytes)).fold(0L)(_ ^ _)

0 commit comments

Comments
 (0)