summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2009-05-28 14:27:32 +0000
committerIulian Dragos <jaguarul@gmail.com>2009-05-28 14:27:32 +0000
commit92b8ae138888ef434a29fab92ea253d6cf69ec57 (patch)
tree606e62b886726d5cb4860c9f406add6dc6ac5292 /src/compiler
parent08da52d9039b1140fe8a76c82f6b367f0f09e871 (diff)
downloadscala-92b8ae138888ef434a29fab92ea253d6cf69ec57.tar.gz
scala-92b8ae138888ef434a29fab92ea253d6cf69ec57.tar.bz2
scala-92b8ae138888ef434a29fab92ea253d6cf69ec57.zip
More precise local variable ranges
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/GenICode.scala4
1 files changed, 2 insertions, 2 deletions
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