systemc: Handle null sc_object names.
A null pointer for an sc_object name is supposed to be equivalent to an empty string. Change-Id: I6094577ad43f13d47a20bc67fa15f4c04d448fe5 Reviewed-on: https://gem5-review.googlesource.com/12257 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
@@ -72,7 +72,7 @@ popObject(Objects *objects, const std::string &name)
|
||||
Object::Object(sc_core::sc_object *_sc_obj) : Object(_sc_obj, "object") {}
|
||||
|
||||
Object::Object(sc_core::sc_object *_sc_obj, const char *obj_name) :
|
||||
_sc_obj(_sc_obj), _basename(obj_name), parent(nullptr)
|
||||
_sc_obj(_sc_obj), _basename(obj_name ? obj_name : ""), parent(nullptr)
|
||||
{
|
||||
if (_basename == "")
|
||||
_basename = "object";
|
||||
|
||||
Reference in New Issue
Block a user