From 86a93fe7b9576045b5e085965ec85692379823e7 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 15 Jun 2010 01:18:36 -0700 Subject: stats: only consider a formula initialized if there is a formula --- src/base/statistics.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/base') diff --git a/src/base/statistics.cc b/src/base/statistics.cc index 59013ed34..ab351567c 100644 --- a/src/base/statistics.cc +++ b/src/base/statistics.cc @@ -238,12 +238,12 @@ Vector2dInfo::enable() Formula::Formula() { - setInit(); } Formula::Formula(Temp r) { root = r; + setInit(); assert(size()); } @@ -252,6 +252,7 @@ Formula::operator=(Temp r) { assert(!root && "Can't change formulas"); root = r; + setInit(); assert(size()); return *this; } @@ -261,8 +262,11 @@ Formula::operator+=(Temp r) { if (root) root = NodePtr(new BinaryNode >(root, r)); - else + else { root = r; + setInit(); + } + assert(size()); return *this; } -- cgit v1.2.3