From be432fe60ee4bd7ae9143a38c7a4f30ad47c5eda Mon Sep 17 00:00:00 2001 From: "Christopher L. Conway" Date: Wed, 27 Oct 2010 22:53:09 +0000 Subject: [PATCH] Small change to documentation in NodeManager::getType --- src/expr/node_manager.cpp | 10 ++++++---- 1 file 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 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; -- 2.30.2