Skip to content

Commit 20f3094

Browse files
Bronsastuarthalloway
authored andcommitted
CLJ-1809 fix local indexing error in direct linking
Signed-off-by: Stuart Halloway <stu@cognitect.com>
1 parent 5da21b3 commit 20f3094

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/jvm/clojure/lang/Compiler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -4012,9 +4012,9 @@ else if(methodArray[f.reqParms.count()] == null)
40124012
{
40134013
for(LocalBinding lb : (Collection<LocalBinding>)RT.keys(fm.locals))
40144014
{
4015-
lb.idx -= 1;
4015+
if(lb.isArg)
4016+
lb.idx -= 1;
40164017
}
4017-
fm.maxLocal -= 1;
40184018
}
40194019
}
40204020
}

test/clojure/test_clojure/compilation.clj

+6
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,9 @@
356356
(is (thrown? RuntimeException (eval '(defn foo [] (throw RuntimeException any-symbol)))))
357357
(is (thrown? RuntimeException (eval '(defn foo [] (throw (RuntimeException.) any-symbol)))))
358358
(is (var? (eval '(defn foo [] (throw (IllegalArgumentException.)))))))
359+
360+
(deftest clj-1809
361+
(is (eval `(fn [y#]
362+
(try
363+
(finally
364+
(let [z# y#])))))))

0 commit comments

Comments
 (0)