summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPat Gavlin <pgavlin@gmail.com>2015-04-29 12:13:49 -0700
committerPat Gavlin <pgavlin@gmail.com>2015-04-29 12:13:49 -0700
commit9579c444040a9fa9780b299cd536cb8ca1b8eaff (patch)
tree0af1fbfbd1e0cf60b503f9fc95444eb8a0c3e966 /src
parent0ed365a06eca99e6f9a85d17f3739dd23e6342c1 (diff)
parent6afc1c7ae052109d159c8fb8fd21b0363374ce72 (diff)
downloadcoreclr-9579c444040a9fa9780b299cd536cb8ca1b8eaff.tar.gz
coreclr-9579c444040a9fa9780b299cd536cb8ca1b8eaff.tar.bz2
coreclr-9579c444040a9fa9780b299cd536cb8ca1b8eaff.zip
Merge pull request #868 from pgavlin/NoMDTypeName
Report a reasonable name for types without metadata.
Diffstat (limited to 'src')
-rw-r--r--src/vm/typestring.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/vm/typestring.cpp b/src/vm/typestring.cpp
index f13b84ff7a..9d86ec9146 100644
--- a/src/vm/typestring.cpp
+++ b/src/vm/typestring.cpp
@@ -979,17 +979,22 @@ void TypeString::AppendType(TypeNameBuilder& tnb, TypeHandle ty, Instantiation t
// Get the TypeDef token and attributes
IMDInternalImport *pImport = ty.GetMethodTable()->GetMDImport();
mdTypeDef td = ty.GetCl();
- _ASSERTE(!IsNilToken(td));
-
-#ifdef _DEBUG
- if (format & FormatDebug)
- {
- WCHAR wzAddress[128];
- _snwprintf_s(wzAddress, 128, _TRUNCATE, W("(%p)"), dac_cast<TADDR>(ty.AsPtr()));
- tnb.AddName(wzAddress);
+ if (IsNilToken(td)) {
+ // This type does not exist in metadata. Simply append "dynamicClass".
+ tnb.AddName(W("(dynamicClass)"));
}
+ else
+ {
+#ifdef _DEBUG
+ if (format & FormatDebug)
+ {
+ WCHAR wzAddress[128];
+ _snwprintf_s(wzAddress, 128, _TRUNCATE, W("(%p)"), dac_cast<TADDR>(ty.AsPtr()));
+ tnb.AddName(wzAddress);
+ }
#endif
- AppendNestedTypeDef(tnb, pImport, td, format);
+ AppendNestedTypeDef(tnb, pImport, td, format);
+ }
// Append the instantiation
if ((format & (FormatNamespace|FormatAssembly)) && ty.HasInstantiation() && (!ty.IsGenericTypeDefinition() || bToString))