Don't attempt to serialize the compiler state if there are errors.
This avoids a crash in some multi-stage compiles.
@@ -1182,9 +1182,11 @@ public abstract class AbstractCommandLineRunner<A extends Compiler,
compiler.parseForCompilation();
if (!compiler.hasErrors()) {
compiler.stage1Passes();
+ }
+ if (!compiler.hasErrors()) {
compiler.saveState(serializedOutputStream);
- compiler.performPostCompilationTasks();
}
+ compiler.performPostCompilationTasks();
} catch (IOException e) {
compiler.report(JSError.make(COULD_NOT_SERIALIZE_AST, filename));
} finally {
