Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java @ 9486:6678695afc3b
NodeUtil.cloneNode: cloned children array should preserve component type.
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 01 May 2013 19:21:32 +0200 |
parents | 8cf939b349dd |
children | 0285fbb8b05d |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Wed May 01 23:02:46 2013 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Wed May 01 19:21:32 2013 +0200 @@ -234,7 +234,8 @@ for (long fieldOffset : nodeClass.nodeArrayFieldOffsets) { Node[] children = (Node[]) unsafe.getObject(orig, fieldOffset); if (children != null) { - Node[] clonedChildren = new Node[children.length]; + Node[] clonedChildren = children.clone(); + Arrays.fill(clonedChildren, null); for (int i = 0; i < children.length; i++) { Node clonedChild = cloneNode(children[i]); if (clonedChild == null) {