Commit 0ca2789a authored by Skylot's avatar Skylot

fix: prevent stack overflow in type inference if update tree is too deep

parent 119709b8
......@@ -151,6 +151,12 @@ public final class TypeUpdate {
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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment