summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2005-12-14 17:00:09 +0000
committerIulian Dragos <jaguarul@gmail.com>2005-12-14 17:00:09 +0000
commit79c0c5404daf502157e4c5788f774fafc53dab91 (patch)
treef1637ebcd4a38291ecf1b674f793b672672d4781
parent0a27645cd58bde3b7df320338727ecf8b21f5964 (diff)
downloadscala-79c0c5404daf502157e4c5788f774fafc53dab91.tar.gz
scala-79c0c5404daf502157e4c5788f774fafc53dab91.tar.bz2
scala-79c0c5404daf502157e4c5788f774fafc53dab91.zip
Fixed wrong code generation for exception handl...
Fixed wrong code generation for exception handlers that finish with 'error'
-rw-r--r--sources/scala/tools/nsc/backend/icode/GenICode.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/scala/tools/nsc/backend/icode/GenICode.scala b/sources/scala/tools/nsc/backend/icode/GenICode.scala
index 6f3047a9c1..5c4b67f5ec 100644
--- a/sources/scala/tools/nsc/backend/icode/GenICode.scala
+++ b/sources/scala/tools/nsc/backend/icode/GenICode.scala
@@ -428,20 +428,21 @@ abstract class GenICode extends SubComponent {
ctx1
case Try(block, catches, finalizer) =>
+ val kind = toTypeKind(tree.tpe);
var handlers = for (val CaseDef(pat, _, body) <- catches.reverse)
yield pat match {
case Typed(Ident(nme.WILDCARD), tpt) => Pair(tpt.tpe.symbol, {
ctx: Context =>
ctx.bb.emit(DROP(REFERENCE(tpt.tpe.symbol)));
val ctx1 = genLoad(finalizer, ctx, UNIT);
- genLoad(body, ctx1, toTypeKind(body.tpe))
+ genLoad(body, ctx1, kind);
})
case Ident(nme.WILDCARD) => Pair(definitions.ThrowableClass, {
ctx: Context =>
ctx.bb.emit(DROP(REFERENCE(definitions.ThrowableClass)));
val ctx1 = genLoad(finalizer, ctx, UNIT);
- genLoad(body, ctx1, toTypeKind(body.tpe))
+ genLoad(body, ctx1, kind)
})
case Bind(name, _) =>
@@ -452,7 +453,7 @@ abstract class GenICode extends SubComponent {
ctx: Context =>
ctx.bb.emit(STORE_LOCAL(exception, false), pat.pos);
val ctx1 = genLoad(finalizer, ctx, UNIT);
- genLoad(body, ctx1, toTypeKind(body.tpe))
+ genLoad(body, ctx1, kind)
})
}