# HG changeset patch # User Tom Rodriguez # Date 1434502321 25200 # Node ID 040fcf0fd8c97d5ba51c30102888035e12b1e635 # Parent a201f2778581db0f74ce2a3692fc91133eb33235 Review feedback on comments diff -r a201f2778581 -r 040fcf0fd8c9 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Tue Jun 16 17:51:58 2015 -0700 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Tue Jun 16 17:52:01 2015 -0700 @@ -167,16 +167,17 @@ } /** - * Delete all other successors except for the one reached by {@code survivingEdge}. Deleting a - * branch can change the successors and the same successor might appear multiple times in the - * {@link #successors} list, so use node identity for the comparision and don't cache the - * surviving AbstractBeginNode. + * Delete all other successors except for the one reached by {@code survivingEdge}. * * @param tool * @param survivingEdge index of the edge in the {@link SwitchNode#successors} list */ protected void killOtherSuccessors(SimplifierTool tool, int survivingEdge) { for (Node successor : successors()) { + /* + * Deleting a branch change change the successors so reload the surviving successor each + * time. + */ if (successor != blockSuccessor(survivingEdge)) { tool.deleteBranch(successor); }