Skip to content

Commit 41c484f

Browse files
committed
Merge pull request #728 from dotty-staging/rehash-SO-fix
Fix StackOverflow in Names.rehash
2 parents 74c2e23 + b2f64b6 commit 41c484f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dotty/tools/dotc/core/Names.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,11 @@ object Names {
268268
/** Rehash chain of names */
269269
def rehash(name: TermName): Unit =
270270
if (name != null) {
271-
rehash(name.next)
271+
val oldNext = name.next
272272
val h = hashValue(chrs, name.start, name.length) & (table.size - 1)
273273
name.next = table(h)
274274
table(h) = name
275+
rehash(oldNext)
275276
}
276277

277278
/** Make sure the hash table is large enough for the given load factor */

0 commit comments

Comments
 (0)