summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2010-08-11 09:44:08 -0400
committerStuart Halloway <stu@thinkrelevance.com>2010-08-12 09:15:57 -0400
commit2cbbca72f1dce59ca617968f2a6e7608df0d9c7f (patch)
treec189e2c2641d2d2ae2a9784df40042197a813cb1
parent3a3374f714e5a755b7de2a761f37696f07a74e80 (diff)
Emit finally exception table entry for each try/catch clause. Refs #422
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
-rw-r--r--src/jvm/clojure/lang/Compiler.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java
index f5684f1b..130ed5d8 100644
--- a/src/jvm/clojure/lang/Compiler.java
+++ b/src/jvm/clojure/lang/Compiler.java
@@ -1719,7 +1719,6 @@ public static class TryExpr implements Expr{
public void emit(C context, ObjExpr objx, GeneratorAdapter gen){
Label startTry = gen.newLabel();
Label endTry = gen.newLabel();
- Label endTryCatch = gen.newLabel();
Label end = gen.newLabel();
Label ret = gen.newLabel();
Label finallyLabel = gen.newLabel();
@@ -1755,7 +1754,6 @@ public static class TryExpr implements Expr{
finallyExpr.emit(C.STATEMENT, objx, gen);
gen.goTo(ret);
}
- gen.mark(endTryCatch);
if(finallyExpr != null)
{
gen.mark(finallyLabel);
@@ -1775,7 +1773,14 @@ public static class TryExpr implements Expr{
gen.visitTryCatchBlock(startTry, endTry, clause.label, clause.c.getName().replace('.', '/'));
}
if(finallyExpr != null)
- gen.visitTryCatchBlock(startTry, endTryCatch, finallyLabel, null);
+ {
+ gen.visitTryCatchBlock(startTry, endTry, finallyLabel, null);
+ for(int i = 0; i < catchExprs.count(); i++)
+ {
+ CatchClause clause = (CatchClause) catchExprs.nth(i);
+ gen.visitTryCatchBlock(clause.label, clause.endLabel, finallyLabel, null);
+ }
+ }
for(int i = 0; i < catchExprs.count(); i++)
{
CatchClause clause = (CatchClause) catchExprs.nth(i);