summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-09-28 10:48:04 +0000
committerMartin Odersky <odersky@gmail.com>2011-09-28 10:48:04 +0000
commiteeaec410f05b211d22d3f0ec5d69b427ce3192b5 (patch)
tree7f9f122a40ceb9082c1526c55020690128167368 /src
parent288faf969a5b72f0ce988cb2adeb662a51b49f73 (diff)
downloadscala-eeaec410f05b211d22d3f0ec5d69b427ce3192b5.tar.gz
scala-eeaec410f05b211d22d3f0ec5d69b427ce3192b5.tar.bz2
scala-eeaec410f05b211d22d3f0ec5d69b427ce3192b5.zip
Fixed infinite loop in reification reported by ...
Fixed infinite loop in reification reported by Paul.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/reflect/internal/Names.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/LiftCode.scala15
2 files changed, 9 insertions, 8 deletions
diff --git a/src/compiler/scala/reflect/internal/Names.scala b/src/compiler/scala/reflect/internal/Names.scala
index 189929b1df..4cab47fe65 100644
--- a/src/compiler/scala/reflect/internal/Names.scala
+++ b/src/compiler/scala/reflect/internal/Names.scala
@@ -76,7 +76,7 @@ trait Names extends api.Names {
val h = hashValue(cs, offset, len) & HASH_MASK
var n = termHashtable(h)
while ((n ne null) && (n.length != len || !equals(n.start, cs, offset, len)))
- n = n.next;
+ n = n.next
if (n eq null) {
// The logic order here is future-proofing against the possibility
// that name.toString will become an eager val, in which case the call
diff --git a/src/compiler/scala/tools/nsc/transform/LiftCode.scala b/src/compiler/scala/tools/nsc/transform/LiftCode.scala
index 431aa28541..d88fd88ac7 100644
--- a/src/compiler/scala/tools/nsc/transform/LiftCode.scala
+++ b/src/compiler/scala/tools/nsc/transform/LiftCode.scala
@@ -131,14 +131,15 @@ abstract class LiftCode extends Transform with TypingTransformers {
private def isLocatable(sym: Symbol) =
sym.isPackageClass || sym.owner.isClass || sym.isTypeParameter && sym.paramPos >= 0
- private def registerReifiableSymbol(sym: Symbol): Unit = {
- sym.owner.ownersIterator.find(!isLocatable(_)) match {
- case Some(outer) => registerReifiableSymbol(outer)
- case None =>
+ private def registerReifiableSymbol(sym: Symbol): Unit =
+ if (!(symIndex contains sym)) {
+ sym.owner.ownersIterator.find(!isLocatable(_)) match {
+ case Some(outer) => registerReifiableSymbol(outer)
+ case None =>
+ }
+ symIndex(sym) = reifiableSyms.length
+ reifiableSyms += sym
}
- symIndex(sym) = reifiableSyms.length
- reifiableSyms += sym
- }
// helper methods