diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-06-07 15:56:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-06-07 15:56:00 +0000 |
commit | bd0a846069dc0e91461bc20996358b3ff4ad0339 (patch) | |
tree | 1cf4eaccb8076a5931d47bae6b3659791cba7fb9 /Carpet | |
parent | 90cbb4ea52fdd09f613558536d5a864fd687fc0a (diff) |
Carpet: Check arguments to GroupStorage{In,De}crease
darcs-hash:20050607155615-891bb-487f0b16b92daab737ded448cfee67aa01d99b74.gz
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/Carpet/src/Storage.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Carpet/Carpet/src/Storage.cc b/Carpet/Carpet/src/Storage.cc index d11dfaa0e..e445a9772 100644 --- a/Carpet/Carpet/src/Storage.cc +++ b/Carpet/Carpet/src/Storage.cc @@ -35,6 +35,11 @@ namespace Carpet { assert (groups); assert (timelevels); for (int n=0; n<n_groups; ++n) { + if (groups[n] < 0 or groups[n] >= CCTK_NumGroups()) { + CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, + "Group index %d is illegal", groups[n]); + return -1; + } assert (groups[n] >= 0 and groups[n] < CCTK_NumGroups()); // TODO: timelevels[n] can also be -1; in that case, all time // levels should be activated / deactivated |