Accellera checks for a null pointer, and a test tries using that input.
Change-Id: I0f098f53de37ebbe481ea46e61fc0a9a404c29db
Reviewed-on: https://gem5-review.googlesource.com/c/13302
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
const char *
sc_gen_unique_name(const char *seed)
{
+ if (!seed || seed[0] == '\0') {
+ SC_REPORT_ERROR(
+ "(E532) cannot generate unique name from null string", "");
+ seed = "unnamed";
+ }
+
auto mod = sc_gem5::pickParentModule();
if (mod)
return mod->uniqueName(seed);
+
sc_gem5::Process *p = sc_gem5::scheduler.current();
if (p)
return p->uniqueName(seed);
+
return ::sc_gem5::nameGen.gen(seed);
}