From 79c0c5404daf502157e4c5788f774fafc53dab91 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Wed, 14 Dec 2005 17:00:09 +0000 Subject: Fixed wrong code generation for exception handl... Fixed wrong code generation for exception handlers that finish with 'error' --- sources/scala/tools/nsc/backend/icode/GenICode.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sources') 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) }) } -- cgit v1.2.3