From 7ef1dd1b6161f825b3cb193a8b05260828fc2b42 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 17 Dec 2010 15:07:44 +0000 Subject: Fixed compiler crash on malformed source file. --- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala') diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 071926e7c6..da156684c0 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2771,7 +2771,11 @@ self => case stats => val start = if (stats forall (_ == EmptyTree)) 0 - else wrappingPos(stats).startOrPoint + else { + val wpos = wrappingPos(stats) + if (wpos.isDefined) wpos.startOrPoint + else 0 + } makePackaging(start, atPos(start, start, start) { Ident(nme.EMPTY_PACKAGE_NAME) }, stats) } -- cgit v1.2.3