fix serious regression breakage (segfaults) caused by an off-by-one error in initiali...
authorMorgan Deters <mdeters@gmail.com>
Sat, 26 Feb 2011 21:18:14 +0000 (21:18 +0000)
committerMorgan Deters <mdeters@gmail.com>
Sat, 26 Feb 2011 21:18:14 +0000 (21:18 +0000)
src/expr/expr_manager_template.cpp

index 65429c87fec54139a1423ea5d18d6e6d4c9e4ef3..b60876967fc4aa6b3492cd08ccea899400b8d604 100644 (file)
@@ -75,7 +75,7 @@ ExprManager::ExprManager() :
   for (unsigned i = 0; i < kind::LAST_KIND; ++ i) {
     d_exprStatistics[i] = NULL;
   }
-  for (unsigned i = 0; i < LAST_TYPE; ++ i) {
+  for (unsigned i = 0; i <= LAST_TYPE; ++ i) {
     d_exprStatisticsVars[i] = NULL;
   }
 #endif
@@ -85,7 +85,7 @@ ExprManager::ExprManager(const Options& options) :
   d_ctxt(new Context),
   d_nodeManager(new NodeManager(d_ctxt, options)) {
 #ifdef CVC4_STATISTICS_ON  
-  for (unsigned i = 0; i < LAST_TYPE; ++ i) {
+  for (unsigned i = 0; i <= LAST_TYPE; ++ i) {
     d_exprStatisticsVars[i] = NULL;
   }
   for (unsigned i = 0; i < kind::LAST_KIND; ++ i) {
@@ -104,7 +104,7 @@ ExprManager::~ExprManager() {
       delete d_exprStatistics[i];
     }
   }
-  for (unsigned i = 0; i < LAST_TYPE; ++ i) {
+  for (unsigned i = 0; i <= LAST_TYPE; ++ i) {
     if (d_exprStatisticsVars[i] != NULL) {
       StatisticsRegistry::unregisterStat(d_exprStatisticsVars[i]);
       delete d_exprStatisticsVars[i];