Truffle: [NodeUtil.findFirstNodeInstance(..) + SpecializationNode.next]: NullPointerException!!
Christian Humer
christian.humer at gmail.com
Sun Jun 7 17:08:42 UTC 2015
Hi Mohaned,
I am not sure its related to the next pointer. Can you provide me with some
some test code that I can run as well as the full stack trace?
My first guess would be that you have a field annotated with @Children that is
null. Can you also show me the code of the node that is responsible for the
error?
Anyway I think nodeAt should be more robust with null values in fields
annotated with @Children. Will discuss this in the meantime.
Thanks.
- Christian Humer
"Mohaned Y Qunaibit" <mqunaibi at uci.edu> wrote:
> Hi,
>
> 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 SpecializationNode.next 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_);*
> NodeClass.java: 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[])
> childrenField.getObject(node);
> if (idx < nodeCount + nodeArray.length) {
> return (Node) nodeArray[idx - nodeCount];
> }
> nodeCount += nodeArray.length;
> }
> }
> return null;
> }
>
> Any idea on how to fix/avoid it?
>
> Best,
> Mohaned Qunaibit
More information about the graal-dev
mailing list