Permalink
Browse files

[backport] Fix for SI-6154, VerifyError originating in uncurry.

Lhs still might be an Ident.  Miguel did all the work,
I just wrote it down in code form.
(cherry picked from commit 48f8235)
  • Loading branch information...
1 parent eff78b8 commit d3f3394fbdfbc82111b9aff71f0e32e2ad578d98 @paulp paulp committed with retronym Jul 30, 2012
Showing with 12 additions and 1 deletion.
  1. +1 −1 src/compiler/scala/tools/nsc/transform/UnCurry.scala
  2. +1 −0 test/files/run/t6154.check
  3. +10 −0 test/files/run/t6154.scala
View
2 src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -627,7 +627,7 @@ abstract class UnCurry extends InfoTransform
}
}
- case Assign(Select(_, _), _) =>
+ case Assign(_: RefTree, _) =>
withNeedLift(true) { super.transform(tree) }
case Assign(lhs, _) if lhs.symbol.owner != currentMethod || lhs.symbol.hasFlag(LAZY | ACCESSOR) =>
View
1 test/files/run/t6154.check
@@ -0,0 +1 @@
+ok
View
10 test/files/run/t6154.scala
@@ -0,0 +1,10 @@
+object Test {
+ def foo(a: Int) {
+ var bar: Int = 0
+ bar = try { 0 } catch { case ex: Throwable => 0 }
+ new { foo(bar) }
+ }
+
+ def main(args: Array[String]): Unit =
+ try foo(0) catch { case _: java.lang.StackOverflowError => println("ok") }
+}

0 comments on commit d3f3394

Please sign in to comment.