From 5a4407b3b693ca22a80f4aa1359c6ccf3f27f694 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 22 Aug 2018 21:54:19 -0700 Subject: [PATCH] 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 Maintainer: Gabe Black --- src/systemc/core/object.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systemc/core/object.cc b/src/systemc/core/object.cc index e066a239f..1fb1d4591 100644 --- a/src/systemc/core/object.cc +++ b/src/systemc/core/object.cc @@ -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"; -- 2.30.2