Skip to content

Commit

Permalink
track use of this fn by nested closures - CLJ-1825
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Nov 12, 2015
1 parent 9448d62 commit 7faeb3a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/jvm/clojure/lang/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7251,15 +7251,20 @@ static Namespace currentNS(){
static void closeOver(LocalBinding b, ObjMethod method){
if(b != null && method != null)
{
if(RT.get(method.locals, b) == null)
LocalBinding lb = (LocalBinding) RT.get(method.locals, b);
if(lb == null)
{
method.objx.closes = (IPersistentMap) RT.assoc(method.objx.closes, b, b);
closeOver(b, method.parent);
}
else if(IN_CATCH_FINALLY.deref() != null)
{
method.localsUsedInCatchFinally = (PersistentHashSet) method.localsUsedInCatchFinally.cons(b.idx);
}
else {
if(lb.idx == 0)
method.usesThis = true;
if(IN_CATCH_FINALLY.deref() != null)
{
method.localsUsedInCatchFinally = (PersistentHashSet) method.localsUsedInCatchFinally.cons(b.idx);
}
}
}
}

Expand Down

0 comments on commit 7faeb3a

Please sign in to comment.