# HG changeset patch # User Thomas Wuerthinger # Date 1379255492 -7200 # Node ID 4ab1f371adc8573850e0c161bc6a6a6d5fb74a7b # Parent a21a54b7ead15027d01d8f914b19c20b9c580bfa Do not assign new source section if replacing node already has source section assigned. diff -r a21a54b7ead1 -r 4ab1f371adc8 graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Sun Sep 15 16:31:11 2013 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Sun Sep 15 16:31:32 2013 +0200 @@ -75,7 +75,7 @@ // source attribution, which would otherwise trigger this // exception. This method will eventually be deprecated. if (getSourceSection() != section) { - throw new IllegalStateException("Source section is already assigned."); + throw new IllegalStateException("Source section is already assigned. Old: " + getSourceSection() + ", new: " + section); } } this.sourceSection = section; @@ -174,7 +174,7 @@ if (this.getParent() == null) { throw new IllegalStateException("This node cannot be replaced, because it does not yet have a parent."); } - if (sourceSection != null) { + if (sourceSection != null && newNode.getSourceSection() == null) { // Pass on the source section to the new node. newNode.assignSourceSection(sourceSection); }