New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.4x: System.NullReferenceException in CSharpDecompiler.DetectBestEnumValueDisplayMode #1323

Closed
greenozon opened this Issue Nov 24, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@greenozon

greenozon commented Nov 24, 2018

ILSpy version 4.0.0.4382-beta2

System.NullReferenceException: Object reference not set to an instance of an object.
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DetectBestEnumValueDisplayMode(ITypeDefinition typeDef, PEFile module)
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompile(ITypeDefinition typeDef, DecompileRun decompileRun, ITypeResolveContext decompilationContext)
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.Decompile(IList`1 definitions)
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.Decompile(EntityHandle[] definitions)
   at ICSharpCode.ILSpy.CSharpLanguage.DecompileType(ITypeDefinition type, ITextOutput output, DecompilationOptions options)
   at ICSharpCode.ILSpy.TreeNodes.TypeTreeNode.Decompile(Language language, ITextOutput output, DecompilationOptions options)
   at ICSharpCode.ILSpy.TextView.DecompilerTextView.DecompileNodes(DecompilationContext context, ITextOutput textOutput)
   at ICSharpCode.ILSpy.TextView.DecompilerTextView.<>c__DisplayClass34_0.<DecompileAsync>b__0()

@greenozon

This comment has been minimized.

greenozon commented Nov 24, 2018

Corresponding IL for above issue:

.class nested public auto ansi sealed Enum0
	extends [mscorlib]System.Enum
{
	// Fields
	.field public specialname rtspecialname int32 value__
	.field public static literal valuetype ns0.Class0/Enum0 const_0
	.field public static literal valuetype ns0.Class0/Enum0 const_1
	.field public static literal valuetype ns0.Class0/Enum0 const_2
	.field public static literal valuetype ns0.Class0/Enum0 const_3

} // end of class Enum0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment