ILSpy icon indicating copy to clipboard operation
ILSpy copied to clipboard

pdbgen, unhandled case (unsafe, pinned var)

Open tamlin-mike opened this issue 4 years ago • 2 comments

DebugInfoGenerator.HandleMethodBody assert failure.

functionis a getter. function.Variables = 2. In the assert, v.Type = System.Byte*. types[v.Index.Value] is System.Byte& pinned.

The decompiler itself handles this case, suggesting the fix could be straightforward.

tamlin-mike avatar Nov 20 '19 17:11 tamlin-mike

@dgrunwald Do you think we should relax the assertion in this case? Would type normalization help in this case?

siegfriedpammer avatar Sep 06 '20 08:09 siegfriedpammer

I have encountered a similar problem involving nullable annotated local variables. (string?).Equals(string) returns false, resulting in an assertion failure. My solution to this problem would be to apply type erasure, i.e., erase all type information that will never appear in local variable signatures.

siegfriedpammer avatar Oct 11 '20 20:10 siegfriedpammer