From: Morgan Deters Date: Sat, 26 Feb 2011 21:18:14 +0000 (+0000) Subject: fix serious regression breakage (segfaults) caused by an off-by-one error in initiali... X-Git-Tag: cvc5-1.0.0~8688 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c9af4e1382d32352aae7f8c31795831882931b2;p=cvc5.git fix serious regression breakage (segfaults) caused by an off-by-one error in initialization of the expression variable statistics in last commit --- diff --git a/src/expr/expr_manager_template.cpp b/src/expr/expr_manager_template.cpp index 65429c87f..b60876967 100644 --- a/src/expr/expr_manager_template.cpp +++ b/src/expr/expr_manager_template.cpp @@ -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];