From df1b94e7d80dd7901336979d255504b76fbe08c1 Mon Sep 17 00:00:00 2001 From: Miguel Garcia Date: Tue, 10 Jul 2012 15:24:21 +0200 Subject: bandaid in GenASM for SI-6049 --- src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index 32c100b026..e7fb287d22 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -2237,9 +2237,15 @@ abstract class GenASM extends SubComponent with BytecodeWriters { val st = pending.getOrElseUpdate(lv, mutable.Stack.empty[Label]) st.push(start) } - def popScope(lv: Local, end: Label) { - val start = pending(lv).pop() - seen ::= LocVarEntry(lv, start, end) + def popScope(lv: Local, end: Label, iPos: Position) { + pending.get(lv) match { + case Some(st) if st.nonEmpty => + val start = st.pop() + seen ::= LocVarEntry(lv, start, end) + case _ => + // TODO SI-6049 + getCurrentCUnit().warning(iPos, "Visited SCOPE_EXIT before visiting corresponding SCOPE_ENTER. SI-6049") + } } def getMerged(): collection.Map[Local, List[Interval]] = { @@ -2452,7 +2458,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { // similarly, these labels aren't tracked in the `labels` map. val end = new asm.Label jmethod.visitLabel(end) - scoping.popScope(lv, end) + scoping.popScope(lv, end, instr.pos) } } -- cgit v1.2.3