DfaMemoryStateImpl: fix SOE when canonicalizing the stack value (EA-139129)

This commit is contained in:
Tagir Valeev
2019-03-11 14:37:53 +07:00
parent 25b29dda44
commit 90aab8b9c4
@@ -1491,6 +1491,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
EqClass eqClass = variable.getDependentVariables().isEmpty() ? null : getEqClass(variable);
DfaVariableValue newCanonical =
eqClass == null ? null : StreamEx.of(eqClass.getVariables(false)).without(variable).min(EqClass.CANONICAL_VARIABLE_COMPARATOR)
.filter(candidate -> !candidate.dependsOn(variable))
.orElse(null);
myStack.replaceAll(value -> handleStackValueOnVariableFlush(value, variable, newCanonical));