summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-06-15 01:18:36 -0700
committerNathan Binkert <nate@binkert.org>2010-06-15 01:18:36 -0700
commit86a93fe7b9576045b5e085965ec85692379823e7 (patch)
treeb6132ca65b7a1374212609b1904a316cbad90616 /src/base
parent54d813adcaf6d5eda4040c20bae1706b0a78324b (diff)
downloadgem5-86a93fe7b9576045b5e085965ec85692379823e7.tar.xz
stats: only consider a formula initialized if there is a formula
Diffstat (limited to 'src/base')
-rw-r--r--src/base/statistics.cc8
1 files changed, 6 insertions, 2 deletions
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<std::plus<Result> >(root, r));
- else
+ else {
root = r;
+ setInit();
+ }
+
assert(size());
return *this;
}