From a54011bc85f4166d36c4def80aa4691b66716a18 Mon Sep 17 00:00:00 2001 From: Miguel Garcia Date: Thu, 24 May 2012 18:15:50 +0200 Subject: [PATCH] Fixes SI-5805 --- src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index 81fe907a0c36..99832d1327aa 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -223,8 +223,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { // unlike javaNameCache, reverseJavaName contains entries only for class symbols and their internal names. val reverseJavaName = mutable.Map.empty[String, Symbol] ++= List( - binarynme.RuntimeNothing.toString() -> NothingClass, // neither RuntimeNothingClass nor RuntimeNullClass belong to the co-domain of this map. - binarynme.RuntimeNull.toString() -> NullClass + binarynme.RuntimeNothing.toString() -> RuntimeNothingClass, // RuntimeNothingClass is the bytecode-level return type of Scala methods with Nothing return-type. + binarynme.RuntimeNull.toString() -> RuntimeNullClass ) private def mkFlags(args: Int*) = args.foldLeft(0)(_ | _) @@ -587,7 +587,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { case None => reverseJavaName.put(internalName, trackedSym) case Some(oldsym) => - assert(List(NothingClass, NullClass).contains(oldsym) || oldsym == trackedSym, + assert((oldsym == trackedSym) || List(RuntimeNothingClass, RuntimeNullClass).contains(oldsym), // NothingClass, NullClass, "how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name.") } } @@ -2542,7 +2542,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters { } else if(kind.isRefOrArrayType) { // REFERENCE(_) | ARRAY(_) val Success = success val Failure = failure - (cond, nextBlock) match { + // @unchecked because references aren't compared with GT, GE, LT, LE. + ((cond, nextBlock) : @unchecked) match { case (EQ, Success) => jcode emitIFNONNULL labels(failure) case (NE, Failure) => jcode emitIFNONNULL labels(success) case (EQ, Failure) => jcode emitIFNULL labels(success)