summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2006-03-20 16:00:19 +0000
committerIulian Dragos <jaguarul@gmail.com>2006-03-20 16:00:19 +0000
commit1ef57837fb0a1dc6660bed25097f8cbc9db69d46 (patch)
treec61bc2119e08899eaa5a707ee24a50556664c77b /src
parent0a5eb2c599eead1eeba7559ed0dcc5706079bf4d (diff)
downloadscala-1ef57837fb0a1dc6660bed25097f8cbc9db69d46.tar.gz
scala-1ef57837fb0a1dc6660bed25097f8cbc9db69d46.tar.bz2
scala-1ef57837fb0a1dc6660bed25097f8cbc9db69d46.zip
Exception thrown by the very last instruction i...
Exception thrown by the very last instruction in a method are now cought.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
index d4ad144c3a..517059b31c 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
@@ -359,6 +359,10 @@ abstract class GenJVM extends SubComponent {
/** Generate exception handlers for the current method. */
def genExceptionHandlers: Unit = {
+ /** Return a list of pairs of intervals where the handler is active.
+ * The intervals in the list have to be inclusive in the beginning and
+ * exclusive in the end: [start, end).
+ */
def ranges(e: ExceptionHandler): List[Pair[Int, Int]] = {
var covered = e.covered;
var ranges: List[Pair[Int, Int]] = Nil;
@@ -383,8 +387,12 @@ abstract class GenJVM extends SubComponent {
}
});
+ /* Add the last interval. Note that since the intervals are
+ * open-ended to the right, we have to give a number past the actual
+ * code!
+ */
if (start >= 0) {
- ranges = Pair(start, end) :: ranges;
+ ranges = Pair(start, jcode.getPC()) :: ranges;
}
if (covered != Nil)