From: Nathan Binkert Date: Sun, 18 Feb 2007 06:36:39 +0000 (-0800) Subject: Check that there is a param context list before trying X-Git-Tag: m5_2.0_beta3~185 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01f32efa4b3c25ad6323ec3e76d756b442a8f419;p=gem5.git 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 --- 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::iterator iter; + if (!ctxList) + return; + list::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::iterator iter; + if (!ctxList) + return; + list::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::iterator iter; + if (!ctxList) + return; + list::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::iterator iter; + if (!ctxList) + return; + list::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::iterator iter; + if (!ctxList) + return; + list::iterator iter; for (iter = ctxList->begin(); iter != ctxList->end(); ++iter) { ParamContext *pc = *iter;