Truffle: [NodeUtil.findFirstNodeInstance(..) +]: NullPointerException!!

Mohaned Y Qunaibit mqunaibi at
Sat Jun 6 22:47:24 UTC 2015


While I was merging the new changes on Graal+Truffle for ZipPy, I got null
pointer exception when calling NodeUtil.findFirstNodeInstance(..) function.

The problem is related to the child. Since next is
the only child of the uninitialized node NodeClass().getChildren() returns
a list with null child and cause this issue.

More specifically when fetching
*childFields[0].getObject(UninitializedNode_);* 215
        private Node nodeAt(int idx) {
            int nodeCount = childFields.length;
            if (idx < nodeCount) {
                return (Node) *childFields[idx].getObject(node);*
            } else {
                for (NodeFieldAccessor childrenField : childrenFields) {
                    Object[] nodeArray = (Object[])
                    if (idx < nodeCount + nodeArray.length) {
                        return (Node) nodeArray[idx - nodeCount];
                    nodeCount += nodeArray.length;
            return null;

Any idea on how to fix/avoid it?

Mohaned Qunaibit

More information about the graal-dev mailing list