From cac9b999740fc779832e92778147cf8cd4cacc2d Mon Sep 17 00:00:00 2001 From: Jon Haslam Date: Mon, 12 Jun 2023 16:47:34 -0700 Subject: [PATCH] ensure oi_name is never a nullptr (#165) --- oi/DrgnUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oi/DrgnUtils.cpp b/oi/DrgnUtils.cpp index f9f4cfe..e7a4a0c 100644 --- a/oi/DrgnUtils.cpp +++ b/oi/DrgnUtils.cpp @@ -122,8 +122,10 @@ std::string typeToName(drgn_type* type) { const char* typeTag = drgn_type_tag(type); if (typeTag != nullptr) { typeName = typeTag; - } else { + } else if (type->_private.oi_name != nullptr) { typeName = type->_private.oi_name; + } else { + typeName = ""; } // TODO: Lookup unnamed union in type->string flag } else if (drgn_type_has_name(type)) {