summaryrefslogtreecommitdiff
path: root/cpu/base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/base.cc')
-rw-r--r--cpu/base.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpu/base.cc b/cpu/base.cc
index a6e71c808..8b94b8533 100644
--- a/cpu/base.cc
+++ b/cpu/base.cc
@@ -36,6 +36,7 @@
#include "base/output.hh"
#include "cpu/base.hh"
#include "cpu/exec_context.hh"
+#include "cpu/profile.hh"
#include "cpu/sampler/sampler.hh"
#include "sim/param.hh"
#include "sim/sim_events.hh"
@@ -254,7 +255,8 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU)
intstatus = oldCPU->intstatus;
for (int i = 0; i < execContexts.size(); ++i)
- execContexts[i]->profile->clear();
+ if (execContexts[i]->profile)
+ execContexts[i]->profile->clear();
if (profileEvent)
profileEvent->schedule(curTick);