Skip to content

Commit

Permalink
Emit finally exception table entry for each try/catch clause. Refs #422
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information
Chouser authored and stuarthalloway committed Aug 13, 2010
1 parent 62b9066 commit 5d40222
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/jvm/clojure/lang/Compiler.java
Expand Up @@ -1719,7 +1719,6 @@ public Object eval() throws Exception{
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();
Expand Down Expand Up @@ -1755,7 +1754,6 @@ public void emit(C context, ObjExpr objx, GeneratorAdapter gen){
finallyExpr.emit(C.STATEMENT, objx, gen);
gen.goTo(ret);
}
gen.mark(endTryCatch);
if(finallyExpr != null)
{
gen.mark(finallyLabel);
Expand All @@ -1775,7 +1773,14 @@ public void emit(C context, ObjExpr objx, GeneratorAdapter gen){
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);
Expand Down

0 comments on commit 5d40222

Please sign in to comment.