base-stats: Fix self addition bug in addStatGroup
A group cannot be added to itself; otherwise, it would create a cyclic dependency. Change-Id: I2e42f84814c675e8d5318cfda2d99b1b394758aa Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43011 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
committed by
Daniel Carvalho
parent
71653e20fb
commit
af2d420b42
@@ -113,6 +113,7 @@ Group::addStat(statistics::Info *info)
|
||||
void
|
||||
Group::addStatGroup(const char *name, Group *block)
|
||||
{
|
||||
panic_if(block == this, "Stat group can't be added to itself");
|
||||
panic_if(statGroups.find(name) != statGroups.end(),
|
||||
"Stats of the same group share the same name `%s`.\n", name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user