diff options
author | Pat Gavlin <pgavlin@gmail.com> | 2015-04-29 12:13:49 -0700 |
---|---|---|
committer | Pat Gavlin <pgavlin@gmail.com> | 2015-04-29 12:13:49 -0700 |
commit | 9579c444040a9fa9780b299cd536cb8ca1b8eaff (patch) | |
tree | 0af1fbfbd1e0cf60b503f9fc95444eb8a0c3e966 /src | |
parent | 0ed365a06eca99e6f9a85d17f3739dd23e6342c1 (diff) | |
parent | 6afc1c7ae052109d159c8fb8fd21b0363374ce72 (diff) | |
download | coreclr-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.cpp | 23 |
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)) |