summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-10-27 22:53:09 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-10-27 22:53:09 +0000
commitbe432fe60ee4bd7ae9143a38c7a4f30ad47c5eda (patch)
tree013c8ca24bef34467d94ec60abe15d6b380c28e7 /src
parent40d8482d24cad4d998240f79e9d6a6745cb845c1 (diff)
Small change to documentation in NodeManager::getType
Diffstat (limited to 'src')
-rw-r--r--src/expr/node_manager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp
index b0592ba2f..2f5ba6824 100644
--- a/src/expr/node_manager.cpp
+++ b/src/expr/node_manager.cpp
@@ -430,15 +430,17 @@ TypeNode NodeManager::getType(TNode n, bool check)
stack<TNode> worklist;
worklist.push(n);
- /* Iterate and compute the children bottom up. */
+ /* Iterate and compute the children bottom up. This avoids stack
+ overflows in computeType() when the Node graph is really
+ deep. */
while( !worklist.empty() ) {
TNode m = worklist.top();
bool readyToCompute = true;
- TNode::iterator it = m.begin();
- TNode::iterator end = m.end();
- for( ; it != end; ++it ) {
+ for( TNode::iterator it = m.begin(), end = m.end() ;
+ it != end;
+ ++it ) {
if( !hasAttribute(*it, TypeAttr())
|| (check && !getAttribute(*it, TypeCheckedAttr())) ) {
readyToCompute = false;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback