summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-02-25 15:42:55 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-02-25 15:42:55 +1000
commit8a332d9e66ac2aa517b4eda33ff3a39159110fa0 (patch)
treef18e6282d58e85e503a06c4660f92168ab425d0f /src
parentdff479907919f59f35c4efa75e46950d8a239b5b (diff)
downloadscala-8a332d9e66ac2aa517b4eda33ff3a39159110fa0.tar.gz
scala-8a332d9e66ac2aa517b4eda33ff3a39159110fa0.tar.bz2
scala-8a332d9e66ac2aa517b4eda33ff3a39159110fa0.zip
SI-9170 Fix resident compilation / specialization NPE
The resident compiler does its best to clean the decks at the conclusion of a compilation batch. One part of this is as follows: if the run was erroneous, reset the info of top level symbols defined in this run to the initial state, that is, to a `SourceFileLoader`. However, if the errors came late in the compilation pipeline, the map from symbols to the source files includes the results of the specialization transformation, which ends up with mappings like `Function1$sp... -> null`. This results in a `NullPointerException` on subsequent runs. This commits filters out null source files during the reset process.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 1c9dbad4dd..b233acf271 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -1551,7 +1551,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
if (reporter.hasErrors) {
for ((sym, file) <- symSource.iterator) {
- sym.reset(new loaders.SourcefileLoader(file))
+ if (file != null)
+ sym.reset(new loaders.SourcefileLoader(file))
if (sym.isTerm)
sym.moduleClass reset loaders.moduleClassLoader
}