Skip to content

Commit

Permalink
fix: prevent stack overflow in type inference if update tree is too deep
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed May 15, 2019
1 parent 119709b commit 0ca2789
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -151,6 +151,12 @@ private TypeUpdateResult requestUpdate(TypeUpdateInfo updateInfo, InsnArg arg, A
return CHANGED;
}
updateInfo.requestUpdate(arg, candidateType);
if (updateInfo.getUpdates().size() > 500) {
if (Consts.DEBUG) {
LOG.error("Type update error: too deep update tree");
}
return REJECT;
}
try {
TypeUpdateResult result = runListeners(updateInfo, arg, candidateType);
if (result == REJECT) {
Expand Down

0 comments on commit 0ca2789

Please sign in to comment.