diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2006-03-20 16:00:19 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2006-03-20 16:00:19 +0000 |
commit | 1ef57837fb0a1dc6660bed25097f8cbc9db69d46 (patch) | |
tree | c61bc2119e08899eaa5a707ee24a50556664c77b /src/compiler | |
parent | 0a5eb2c599eead1eeba7559ed0dcc5706079bf4d (diff) | |
download | scala-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/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 10 |
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) |