Check that no overflow occurs

This commit is contained in:
Your Name 2011-02-24 14:28:13 -05:00
parent 5f9e5eb5d8
commit 6c9644c8de

View file

@ -186,9 +186,11 @@ public:
nodes[p].children.push_back(&nodes[i]);
nodes[i].parent = &nodes[p];
}
inserted++;
}
assert(inserted < totalNumNodes);
rootNode = &nodes[inserted+1];
rootNode->vid = -1;
rootNode->parent = 0;