From 893e8b63912ab7705468282191f8ff3c7c19e89e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 25 Oct 2011 16:24:56 +0000 Subject: Fixed problem when running under -Xcheckinit fo... Fixed problem when running under -Xcheckinit for the code.scala test by avoiding accessing an unitialized variable. Good catch, -Xcheckinit! Review by extempore. --- src/compiler/scala/reflect/internal/SymbolTable.scala | 2 +- src/compiler/scala/tools/nsc/Global.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/reflect/internal/SymbolTable.scala b/src/compiler/scala/reflect/internal/SymbolTable.scala index 873821e790..4b9b9d5959 100644 --- a/src/compiler/scala/reflect/internal/SymbolTable.scala +++ b/src/compiler/scala/reflect/internal/SymbolTable.scala @@ -108,7 +108,7 @@ abstract class SymbolTable extends api.Universe atPhase(ph.next)(op) @inline final def atPhaseNotLaterThan[T](target: Phase)(op: => T): T = - if (target != null && phase.id > target.id) atPhase(target)(op) else op + if (target != NoPhase && phase.id > target.id) atPhase(target)(op) else op final def isValid(period: Period): Boolean = period != 0 && runId(period) == currentRunId && { diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 81f3411dd5..b798fe71ba 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -58,7 +58,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb def mkAttributedQualifier(tpe: Type, termSym: Symbol): Tree = gen.mkAttributedQualifier(tpe, termSym) - def picklerPhase: Phase = currentRun.picklerPhase + def picklerPhase: Phase = if (currentRun.isDefined) currentRun.picklerPhase else NoPhase // platform specific elements -- cgit v1.2.3