summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2007-02-17 22:36:39 -0800
committerNathan Binkert <binkertn@umich.edu>2007-02-17 22:36:39 -0800
commit01f32efa4b3c25ad6323ec3e76d756b442a8f419 (patch)
tree91f4907f08d43caf912c411f397bdcac425d4570
parenta41f17b40e5a1fd121539414abab4e4451199e3e (diff)
downloadgem5-01f32efa4b3c25ad6323ec3e76d756b442a8f419.tar.xz
Check that there is a param context list before trying
to loop through it. This is more important as we get rid of param contexts --HG-- extra : convert_revision : 5a24048b5c3d609285da83dfcb106910afad6919
-rw-r--r--src/sim/param.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/sim/param.cc b/src/sim/param.cc
index 5cc69b161..091d18f71 100644
--- a/src/sim/param.cc
+++ b/src/sim/param.cc
@@ -701,11 +701,12 @@ ParamContext::printErrorProlog(ostream &os)
void
ParamContext::parseAllContexts(IniFile &iniFile)
{
- list<ParamContext *>::iterator iter;
+ if (!ctxList)
+ return;
+ list<ParamContext *>::iterator iter;
for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
ParamContext *pc = *iter;
-
pc->parseParams(iniFile);
}
}
@@ -717,11 +718,12 @@ ParamContext::parseAllContexts(IniFile &iniFile)
void
ParamContext::checkAllContexts()
{
- list<ParamContext *>::iterator iter;
+ if (!ctxList)
+ return;
+ list<ParamContext *>::iterator iter;
for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
ParamContext *pc = *iter;
-
pc->checkParams();
}
}
@@ -733,8 +735,10 @@ ParamContext::checkAllContexts()
void
ParamContext::showAllContexts(ostream &os)
{
- list<ParamContext *>::iterator iter;
+ if (!ctxList)
+ return;
+ list<ParamContext *>::iterator iter;
for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
ParamContext *pc = *iter;
@@ -751,8 +755,10 @@ ParamContext::showAllContexts(ostream &os)
void
ParamContext::cleanupAllContexts()
{
- list<ParamContext *>::iterator iter;
+ if (!ctxList)
+ return;
+ list<ParamContext *>::iterator iter;
for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
ParamContext *pc = *iter;
@@ -767,8 +773,10 @@ ParamContext::cleanupAllContexts()
void
ParamContext::describeAllContexts(ostream &os)
{
- list<ParamContext *>::iterator iter;
+ if (!ctxList)
+ return;
+ list<ParamContext *>::iterator iter;
for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) {
ParamContext *pc = *iter;