summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-10-25 16:24:56 +0000
committerMartin Odersky <odersky@gmail.com>2011-10-25 16:24:56 +0000
commit893e8b63912ab7705468282191f8ff3c7c19e89e (patch)
tree0a3ce60173c9838e41752975fc3b6ced5c38a70b /src/compiler
parent5f0ef121a12c65bb24bf0af79c5f7768fb03f6af (diff)
downloadscala-893e8b63912ab7705468282191f8ff3c7c19e89e.tar.gz
scala-893e8b63912ab7705468282191f8ff3c7c19e89e.tar.bz2
scala-893e8b63912ab7705468282191f8ff3c7c19e89e.zip
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.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/reflect/internal/SymbolTable.scala2
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala2
2 files changed, 2 insertions, 2 deletions
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