From 57f14277dad0427b90abc1e6f70e2f8ae4dcbb51 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Thu, 7 Jan 2010 11:00:20 +0000 Subject: Fixed #2850 -- while inside finally causes Veri... Fixed #2850 -- while inside finally causes VerifyError, review by rytz --- test/files/run/exceptions-2.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/files/run') diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala index 820ab3634d..05aab66dd0 100644 --- a/test/files/run/exceptions-2.scala +++ b/test/files/run/exceptions-2.scala @@ -267,6 +267,23 @@ object Test { try { 1 } catch { case e: java.io.IOException => () } } + /** Test that empty finally clauses containing while are correctly emitted. + */ + class Issue { + var b = 0 + try { + // println("abc") + } finally { + while (b == -1) {b = 0} + } + } + + /* Tests that class Issue passes verification. */ + def whileInFinally = { + new Issue + } + + def main(args: Array[String]): Unit = { Console.println("nested1: "); @@ -326,5 +343,7 @@ object Test { Console.println("Return with finally clause that cleans the stack") returnWithFinallyClean + + whileInFinally } } -- cgit v1.2.3