changeset 37e6eb40cf91 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=37e6eb40cf91
description:
Base CPU: Initialize profileEvent to NULL
The profileEvent pointer is tested against NULL in various places, but
it is not initialized unless running in full-system mode. In SE mode,
this
can result in segmentation faults when profileEvent default intializes
to
something other than NULL.
diffstat:
src/cpu/base.cc | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diffs (20 lines):
diff -r 258753d3bc47 -r 37e6eb40cf91 src/cpu/base.cc
--- a/src/cpu/base.cc Wed Sep 12 14:52:04 2012 -0500
+++ b/src/cpu/base.cc Wed Sep 12 21:40:28 2012 -0500
@@ -118,7 +118,7 @@
: MemObject(p), instCnt(0), _cpuId(p->cpu_id),
_instMasterId(p->system->getMasterId(name() + ".inst")),
_dataMasterId(p->system->getMasterId(name() + ".data")),
- interrupts(p->interrupts),
+ interrupts(p->interrupts), profileEvent(NULL),
numThreads(p->numThreads), system(p->system)
{
// if Python did not provide a valid ID, do it here
@@ -225,7 +225,6 @@
}
if (FullSystem) {
- profileEvent = NULL;
if (params()->profile)
profileEvent = new ProfileEvent(this, params()->profile);
}
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev