Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Prevent an off-by-one towards -Inf and bail if it can't be cached any…
…way.
  • Loading branch information
peschwa committed Oct 23, 2015
1 parent e4334e6 commit 88ef425
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -86,9 +86,12 @@ public void add(CallCaptureInstance capture, SixModelObject result, ThreadContex
}
}

if (numArgs >= MD_CACHE_MAX_ARITY)
return;

/* If the cache is saturated, don't do anything (we could instead do a random
* replacement). */
ArityCache ac = this.arityCaches[numArgs - 1];
ArityCache ac = this.arityCaches[numArgs];
if (ac != null && ac.numEntries == MD_CACHE_MAX_ENTRIES)
return;

Expand Down

0 comments on commit 88ef425

Please sign in to comment.