From 92b8ae138888ef434a29fab92ea253d6cf69ec57 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Thu, 28 May 2009 14:27:32 +0000 Subject: More precise local variable ranges --- src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 98237ef504..2a0acc053b 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -408,8 +408,6 @@ abstract class GenICode extends SubComponent { case ValDef(_, _, _, rhs) => val sym = tree.symbol val local = ctx.method.addLocal(new Local(sym, toTypeKind(sym.info), false)) - ctx.scope.add(local) - ctx.bb.emit(SCOPE_ENTER(local)) if (rhs == EmptyTree) { if (settings.debug.value) @@ -422,6 +420,8 @@ abstract class GenICode extends SubComponent { ctx1 = genLoad(rhs, ctx, local.kind); ctx1.bb.emit(STORE_LOCAL(local), tree.pos) + ctx1.scope.add(local) + ctx1.bb.emit(SCOPE_ENTER(local)) generatedType = UNIT ctx1 -- cgit v1.2.3