# HG changeset patch # User Thomas Wuerthinger # Date 1424894459 -3600 # Node ID 4f8226c98a02a5f04672e5f6bc3f0a27e7c8f51e # Parent b964772c43bd60204ca620609f87b9cbe4c976a6 Improve node error messges when nodes are inserted with non-alive inputs or successors. diff -r b964772c43bd -r 4f8226c98a02 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Wed Feb 25 18:14:35 2015 +0100 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Wed Feb 25 21:00:59 2015 +0100 @@ -521,8 +521,18 @@ assert assertTrue(id == INITIAL_ID, "unexpected id: %d", id); this.graph = newGraph; newGraph.register(this); - this.acceptInputs((n, i) -> n.updateUsages(null, i)); - this.acceptSuccessors((n, s) -> n.updatePredecessor(null, s)); + this.acceptInputs((n, i) -> { + if (!i.isAlive()) { + throw new IllegalStateException(String.format("Input %s of newly created node %s is not alive.", i, n)); + } + n.updateUsages(null, i); + }); + this.acceptSuccessors((n, s) -> { + if (!s.isAlive()) { + throw new IllegalStateException(String.format("Successor %s of newly created node %s is not alive.", s, n)); + } + n.updatePredecessor(null, s); + }); } public final NodeClass getNodeClass() {