Crash reading fields of type with local method and dynamic local
See original GitHub issueIf you have a dynamic
local inside a local method, cecil crashes reading the fields of the compiler generated type.
Expected output of repro project
F:/Unity/dev/TestGround/DyanmicAndLocalMethodRepro/DyanmicAndLocalMethodRepro/bin/Debug/DyanmicAndLocalMethodRepro.exe
DyanmicAndLocalMethodRepro.Program/DynamicInNormalMethod
DyanmicAndLocalMethodRepro.Program/DynamicInNormalMethod/<>o__1`2
System.Runtime.CompilerServices.CallSite`1<System.Func`4<System.Runtime.CompilerServices.CallSite,System.Object,System.Object,System.Object>> DyanmicAndLocalMethodRepro.Program/DynamicInNormalMethod/<>o__1`2::<>p__0
System.Runtime.CompilerServices.CallSite`1<System.Func`3<System.Runtime.CompilerServices.CallSite,System.Object,System.Boolean>> DyanmicAndLocalMethodRepro.Program/DynamicInNormalMethod/<>o__1`2::<>p__1
System.Runtime.CompilerServices.CallSite`1<System.Func`3<System.Runtime.CompilerServices.CallSite,System.Object,T2>> DyanmicAndLocalMethodRepro.Program/DynamicInNormalMethod/<>o__1`2::<>p__2
DyanmicAndLocalMethodRepro.Program/NoDynamicLocalMethod
DyanmicAndLocalMethodRepro.Program/DynamicInsideLocalMethod
DyanmicAndLocalMethodRepro.Program/DynamicInsideLocalMethod/<>o__0
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Mono.Cecil.SignatureReader.GetGenericParameter(GenericParameterType type, UInt32 var)
at Mono.Cecil.SignatureReader.ReadTypeSignature(ElementType etype)
at Mono.Cecil.SignatureReader.ReadGenericInstanceSignature(IGenericParameterProvider provider, IGenericInstance instance, UInt32 arity)
at Mono.Cecil.SignatureReader.ReadTypeSignature(ElementType etype)
at Mono.Cecil.SignatureReader.ReadGenericInstanceSignature(IGenericParameterProvider provider, IGenericInstance instance, UInt32 arity)
at Mono.Cecil.SignatureReader.ReadTypeSignature(ElementType etype)
at Mono.Cecil.MetadataReader.ReadFieldType(UInt32 signature)
at Mono.Cecil.MetadataReader.ReadField(UInt32 field_rid, Collection`1 fields)
at Mono.Cecil.MetadataReader.ReadFields(TypeDefinition type)
at Mono.Cecil.TypeDefinition.<>c.<get_Fields>b__47_0(TypeDefinition type, MetadataReader reader)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
at Mono.Cecil.TypeDefinition.get_Fields()
at DyanmicAndLocalMethodRepro.Program.IterateAllFields(TypeDefinition type) in F:\Unity\dev\TestGround\DyanmicAndLocalMethodRepro\DyanmicAndLocalMethodRepro\Program.cs:line 30
at DyanmicAndLocalMethodRepro.Program.IterateAllFields(TypeDefinition type) in F:\Unity\dev\TestGround\DyanmicAndLocalMethodRepro\DyanmicAndLocalMethodRepro\Program.cs:line 33
at DyanmicAndLocalMethodRepro.Program.Main(String[] args) in F:\Unity\dev\TestGround\DyanmicAndLocalMethodRepro\DyanmicAndLocalMethodRepro\Program.cs:line 23
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
C# reusable function to dump current value of local variables
The short answer is: you can't get the values of the local ... want to have the method have to know the specific...
Read more >Customize your Firebase Crashlytics crash reports
This guide describes how to customize your crash reports using the Firebase Crashlytics SDK. By default, Crashlytics automatically collects crash reports ...
Read more >5.1.8 Server System Variables
Some variables are read-only, and their values are determined by the system environment, by how MySQL is installed on the system, or possibly...
Read more >Server System Variables - MariaDB Knowledge Base
Variables that can be changed at runtime are described as "Dynamic" below, ... Data Type: enumerated; Default Value: DEFAULT; Valid Values: DEFAULT ...
Read more >Express Tutorial Part 3: Using a Database (with Mongoose)
In this article, we've learned a bit about databases and ORMs on Node/Express, and a lot about how Mongoose schema and models are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Why are you doing this to me Mike?
Closing this then.