ensure oi_name is never a nullptr (#165)

This commit is contained in:
Jon Haslam 2023-06-12 16:47:34 -07:00 committed by GitHub
parent ad28fb64b2
commit cac9b99974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {