From 01f32efa4b3c25ad6323ec3e76d756b442a8f419 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sat, 17 Feb 2007 22:36:39 -0800 Subject: [PATCH] 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 --- src/sim/param.cc | 22 +++++++++++++++------- 1 file 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::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; -- 2.30.2