Commit Graph
19 Commits
Author SHA1 Message Date
a8229dcfe1 C# decompiler doesn't support WinRT metadata (#2308)
Fix #2306: Use GetRowNumber MetadataReader extension

Co-authored-by: Siegfried Pammer <[email protected]>
Co-authored-by: Matt Rouse <[email protected]>
2021-02-21 22:44:28 +01:00
Siegfried Pammer f0012cbc1a #2198: Make ILSpy more resilient in case of obfuscated assemblies. 2020-10-25 12:55:33 +01:00
Daniel Grunwald 3831b42197 Properly support calli instruction and its interaction with function pointer types. 2020-09-06 18:59:07 +02:00
dotnet format 0d9f871a4f #2128: Reformat the whole code base. 2020-08-28 01:05:38 +02:00
Daniel Grunwald 8061634e67 #1203, #2092: New logic for resolving assembly references within the type system.
We now avoid the old `IModuleReference` interface which required allocating for every type being resolved.
Instead `MetadataModule.ResolveModule` now combines decoding+resolving assembly references into a single step.
This allows the type system to maintain a cache indexed by row number.

This also changes the behavior of resolving references within a compilation: We now prefer an exact match (name + version + publickeytoken) first; and fall back to a name-only match only if no exact match exists.
This somewhat improves the decompilation of assemblies created by using ilmerge to combine assemblies with different target frameworks.
2020-08-07 00:03:07 +02:00
Daniel Grunwald 5ad7ee0cea Fix #1629: Add support for [module: NullablePublicOnly]
If this attribute is in use, private/internal members lack nullability annotations.
Previously in such cases, we ended up inheriting the nullability from the `[NullableContext]`, which could cause us to display a misleading nullability for primary methods.
In debug builds, it could also trigger an assertion when trying to apply the "nullable reference type" marking to to value types.

Of note is that properties and events are a special case: they do not explicitly store Accessibility in metadata. For properties computing the accessibility requires decoding the signature (to find overridden base properties). So these two only check the declaring type's accessibility instead; private properties may still carry nullability despite `[NullablePublicOnly]`. However, the property accessors won't store nullability, so we need to read the `returnTypeAttributes` from the property itself.
2020-04-19 02:08:18 +02:00
Daniel Grunwald c366235246 #1349: Fix type substitution for members of unknown generic types (due to unresolved references)
Also, assume that unknown inputs to ldfld are temporaries, not unmanaged pointers.
This avoids emitting weird pointer casts when accessing fields on unresolved value types.
2019-07-25 22:47:14 +02:00
Daniel Grunwald b75c252193 Upgrade C# 8.0 nullability support for Roslyn 3.2.0-beta4. 2019-07-24 23:10:33 +02:00
Daniel Grunwald 2f35374d7d Support "where T : unmanaged" constraints. 2019-02-24 01:24:33 +01:00
Daniel Grunwald 7a058f6262 First attempt at integrating C# nullable reference types into the type system. 2019-02-14 21:00:07 +01:00
Siegfried Pammer 27d7bf2e9d Fix bug in MetadataModule.GetInternalsVisibleTo: should extract short asm name, like previous versions did. 2018-12-30 23:10:53 +01:00
Siegfried Pammer 195a1cf55b IModule should implement ISymbol. 2018-07-17 01:28:04 +02:00
Daniel Grunwald 4e8ebbf7f4 Fix #1189: Avoid crashing on invalid IL bytes. 2018-07-16 23:11:19 +02:00
Daniel Grunwald 08e8091336 Fix #1211: Handle BadImageFormatException on invalid local signatures. 2018-07-16 22:40:36 +02:00
Daniel Grunwald ab157b2fc0 Add TypeSystemOptions.Uncached. 2018-07-14 18:48:58 +02:00
Daniel Grunwald de3ffa2851 Adjust ILSpy to type system changes. 2018-07-14 17:13:35 +02:00
Daniel Grunwald 1f3916d554 Use the resolve methods in MetadataModule, and remove the wrappers in DecompilerTypeSystem. 2018-07-14 16:12:03 +02:00
Daniel Grunwald 107fe5eb1c Eliminate SpecializingDecompilerTypeSystem and use GenericContext instead. 2018-07-14 14:18:54 +02:00
Daniel Grunwald 3b46776c5e Rename IAssembly -> IModule.
While support for multi-module assemblies isn't fully working yet; it is clear at this point that we want
to treat each module in a multi-module assembly separately for the purposes of the type system.
2018-07-13 22:20:49 +02:00