diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/
Compiler.java
index f5684f1..af55660 100644
--- a/src/jvm/clojure/lang/Compiler.java
+++ b/src/jvm/clojure/lang/Compiler.java
@@ -1775,7 +1775,7 @@ 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);
This fixes the behavior we're seeing, but, ummm... might break other
things, I suppose. The tests I've written don't cover all the
expected behavior of try/catch/finally.
Joe
On Aug 10, 12:23 pm, joegg <[email protected]> wrote:
> Laurent,
>
> Looking through the output of javap -v, it looks to me like this is
> roughly what's been emitted (please forgive the mix of clojure and
> java):
>
> try {
> (prn :test)
> (swap! a inc)
> (.foo nil)} finally {
>
> (swap! a inc)
> (.foo nil)
>
> }
>
> Which explains why @a is 3 -- I'm not sure this is intended, though.
>
> Joe
>
> On Aug 10, 9:52 am, Laurent PETIT <[email protected]> wrote:
>
>
>
>
>
>
>
> > Weird indeed:
>
> > user=> (def a (atom 1))
> > #'user/a
> > user=> (try (prn :test) (finally (swap! a inc) (.foo nil)))
> > :test
> > java.lang.NullPointerException (NO_SOURCE_FILE:0)
> > user=> @a
> > 3
>
> > I would have expected 2 as a result, in any case ?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en