# HG changeset patch # User Bernhard Urban # Date 1377792140 -7200 # Node ID ff122ed4b9fd1cf9f40b0672afd81141db2cd0de # Parent 2da44804f720bdaffd84a1eed47131e8ce680c79 LoweringPhase: insert begin node to make lowering more robust, if the predecessor is not a FixedWithNextNode anymore fixes GRAAL-436 in a nicer way diff -r 2da44804f720 -r ff122ed4b9fd graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Thu Aug 29 17:28:22 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Thu Aug 29 18:02:20 2013 +0200 @@ -248,11 +248,14 @@ break; } else { Node nextLastFixed = nextNode.predecessor(); - if (nextLastFixed instanceof FixedWithNextNode) { - loweringTool.setLastFixedNode((FixedWithNextNode) nextLastFixed); - } else { - loweringTool.setLastFixedNode((FixedWithNextNode) nextNode); + if (!(nextLastFixed instanceof FixedWithNextNode)) { + // insert begin node, to have a valid last fixed for next lowerable node. + BeginNode begin = node.graph().add(new BeginNode()); + nextLastFixed.replaceFirstSuccessor(nextNode, begin); + begin.setNext(nextNode); + nextLastFixed = begin; } + loweringTool.setLastFixedNode((FixedWithNextNode) nextLastFixed); } } }