summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-10-07 13:55:07 +0000
committerPaul Phillips <paulp@improving.org>2009-10-07 13:55:07 +0000
commitad62d9f8b00d328c099268366ae05c5122915fa6 (patch)
treeec2a82c21fb25bb08f54849ed458fdc56755cde0 /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
parenta6f19f5d97b0a4708d769dd3baa9aeb346d3a918 (diff)
downloadscala-ad62d9f8b00d328c099268366ae05c5122915fa6.tar.gz
scala-ad62d9f8b00d328c099268366ae05c5122915fa6.tar.bz2
scala-ad62d9f8b00d328c099268366ae05c5122915fa6.zip
More revealing error message for the crasher in...
More revealing error message for the crasher in #2433.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index c4283652ec..3e3b4961e0 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -40,7 +40,7 @@ abstract class ClassfileParser {
protected var isScala: Boolean = _ // does class file describe a scala class?
protected var isScalaRaw: Boolean = _ // this class file is a scala class with no pickled info
protected var hasMeta: Boolean = _ // does class file contain jaco meta attribute?s
- protected var busy: Boolean = false // lock to detect recursive reads
+ protected var busy: Option[Symbol] = None // lock to detect recursive reads
private var externalName: Name = _ // JVM name of the current class
protected var classTParams = Map[Name,Symbol]()
@@ -65,8 +65,13 @@ abstract class ClassfileParser {
else e.getClass.toString
} + ")")
}
- assert(!busy, "internal error: illegal class file dependency")
- busy = true
+ assert(!busy.isDefined, {
+ val (s1, s2) = (busy.get, root)
+ if (s1 eq s2) "unsatisfiable cyclic dependency in '%s'".format(s1)
+ else "illegal class file dependency between '%s' and '%s'".format(s1, s2)
+ })
+
+ busy = Some(root)
/*root match {
case cs: ClassSymbol =>
cs.classFile = file
@@ -95,7 +100,7 @@ abstract class ClassfileParser {
case e: RuntimeException => handleError(e)
}
} finally {
- busy = false
+ busy = None
}
protected def statics: Symbol = staticModule.moduleClass